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

Is there a possibility to have a nested struct not declared in openapi spec ? #541

Open
MikeDevresse opened this issue Mar 20, 2023 · 0 comments
Labels
question Further information is requested

Comments

@MikeDevresse
Copy link

Hi,
I have a project that works with Gitlab webhooks. So it receive data under the form:

{
  ...
  "project": {
    ...
    "web_url": "http:https://example.com"
  }
}

In rust because I can't declare nested structures, I declared two structs:

#[derive(Object)]
struct WebhookBody {
    project: WebhookBodyProject,
}

#[derive(Object)]
struct WebhookBodyProject {
    web_url: String,
}

The problem with that is that in my openapi spec, I have a WebhookBodyProject schema, but I only want the WebhookBody one. Is there a way to remove the WebhookBodyProject from the documentation or just remove the #[derive(Object)] and still be able to use it ?

@MikeDevresse MikeDevresse added the question Further information is requested label Mar 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant