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

Tag description #78

Open
barvirm opened this issue Mar 9, 2022 · 1 comment
Open

Tag description #78

barvirm opened this issue Mar 9, 2022 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@barvirm
Copy link

barvirm commented Mar 9, 2022

Is it possible to create a tag description with the current API?

@ralpha
Copy link
Collaborator

ralpha commented Mar 11, 2022

Tags, yes
Tag description, no, not using a macro at least.

You can merge multiple OpenAPI specs like here: https://github.com/GREsau/okapi/blob/master/examples/custom_schema/src/main.rs#L61 or using https://docs.rs/rocket_okapi/0.8.0-rc.1/rocket_okapi/macro.openapi_get_routes_spec.html
Just add your tags and there description.

pub tags: Vec<Tag>,

OpenApi {
    tags: vec![
        Tag {
            name: "Message".to_owned(),
            description: Some("Here is my desc".to_owned()),
        },
        // ...
    ]
}

If you want to add this using macros, PR's are welcome see:

struct OpenApiAttribute {
pub skip: bool,
#[darling(multiple, rename = "tag")]
pub tags: Vec<String>,
}

@ralpha ralpha added help wanted Extra attention is needed good first issue Good for newcomers labels Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants