Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V1 #116

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

V1 #116

wants to merge 1 commit into from

Conversation

rlebran
Copy link
Contributor

@rlebran rlebran commented Jul 12, 2024

Prepare v1 release.
Add support for OAS3.1 (Webhooks and new schema specification) as well as callbacks.

@rlebran rlebran added the enhancement New feature or request label Jul 12, 2024
@rlebran rlebran linked an issue Jul 12, 2024 that may be closed by this pull request
@rlebran rlebran force-pushed the v1 branch 2 times, most recently from a02a244 to d556697 Compare July 12, 2024 14:02
@ShadoySV
Copy link

Hello! Thank you for your work! Looking forward to v1 release. Could you also add this wrapping function to apistos/src/internal/actix/route.rs?

use actix_service::{boxed::BoxService, ServiceFactory, Transform};
use actix_web::body::MessageBody;
use actix_web::dev::{ServiceRequest, ServiceResponse};

impl Route {
  // ...
  
  pub fn wrap<M, B>(self, mw: M) -> Route
  where
    B: MessageBody + 'static,
    M: Transform<
        BoxService<ServiceRequest, ServiceResponse, Error>,
        ServiceRequest,
        Response = ServiceResponse<B>,
        Error = Error,
        InitError = (),
      > + 'static,
  {
    let oas_version = get_oas_version();
    Route {
      oas_version,
      operation: self.operation,
      path_item_type: self.path_item_type,
      components: self.components,
      inner: self.inner.wrap(mw),
    }
  }
}

@rlebran
Copy link
Contributor Author

rlebran commented Sep 19, 2024

Hi, just added it.
Regarding v1, once Schemars v1 is release I plan on doing a documentation effort before releasing Apistos with a stable version.

@antoine-de
Copy link

Thanks for your work!

I just integrated the latest prerelease (here), and a quite happy with the utopia replacement, great work ! It was a bit difficult to sometimes find the right documentation, but it's understandable since it's not yet released 😅

2 things:

  • I might not have found the right way to do this, but I had to dump the use of actix macros to create the routes (not a big deal though)
  • I had trouble with some part of the API that I did not want to document (some html+icons part), and ended up by mounting them to the actix APP before calling .document(spec) so I could use actix only types and skip documentation. I'm not sure if it was the right way to tackle this though.

@rlebran
Copy link
Contributor Author

rlebran commented Sep 20, 2024

Thanks for your work!

I just integrated the latest prerelease (here), and a quite happy with the utopia replacement, great work ! It was a bit difficult to sometimes find the right documentation, but it's understandable since it's not yet released 😅

2 things:

  • I might not have found the right way to do this, but I had to dump the use of actix macros to create the routes (not a big deal though)
  • I had trouble with some part of the API that I did not want to document (some html+icons part), and ended up by mounting them to the actix APP before calling .document(spec) so I could use actix only types and skip documentation. I'm not sure if it was the right way to tackle this though.

Hi,
Thanks for your message !

  • Apistos currently doesn't support actix macros (might be the case one day but it's currently not a priority) which is the main difference between this project and utopia. Out of curiosity, why did you switch ? I'm always happy to receive some feedback and I'm looking for ways to make this project better.
  • It is possible to skip some endpoint to keep them undocumented with something like #[api_operation(skip)] . Documentation is not yet sufficient, some effort will be made on this front in the future.

Todo: determine what to do with internally tagged enum with schemars 1.0.0-alpha.17 behaviour
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Assess how to support OAS 3.1
3 participants