Problems with modifiers(&SecurityAddon) #421
nelsonsilva94
started this conversation in
General
Replies: 1 comment 6 replies
-
What happens in your modifier? struct MyModifier;
impl Modify for MyModifier {
fn modify(&self, &mut openapi: OpenApi) {
// Get access to the existing components or insert new one if none is present.
// If there already is components added with #[openapi(schemas(...))] then the following line should
// return you the existing components list that you can modify.
// Do not override it with new components otherwise you will loose everything that has been already added there.
let components = openapi.components.get_or_insert(Components::new());
}
} Alternatively you can directly use the #[derive(OpenApi)]
struct ApiDoc;
let mut openapi = ApiDoc::openapi();
let mut componets = openapi.componets.get_or_insert(Components::new()); |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
adding the
modifiers(&SecurityAddon)
seems to get schemas errors that previously were correct.Before
modifiers(&SecurityAddon)
:After adding
modifiers(&SecurityAddon)
lineI got the following errors:
All the schemas (auth::UserCredentials, auth::User, auth::AuthError) were Okay before.
Am I missing something pretty obvious?
Thanks in advance,
Cheers
Beta Was this translation helpful? Give feedback.
All reactions