belgif / rest-guide

REST Guidelines of Belgian government institutions
https://www.belgif.be/specification/rest/api-guide/
Apache License 2.0
24 stars 4 forks source link

Naming guideline for openapi tags #102

Closed jpraet closed 5 months ago

jpraet commented 1 year ago

Rule 34: https://www.belgif.be/specification/rest/api-guide/#openapi

When an API has many operations, use tags to group them together. This will make the visual representation (SwaggerUI) more readable.

But it does not talk about how to name tags.

jpraet commented 1 year ago

https://github.com/belgif/rest-guide-example/blob/main/src/main/openapi/openapi.yaml uses UpperCamelCase (no spaces) e.g. "ReferenceData"

pvdbosch commented 1 year ago

For readability, Capitalized Words look best to me.

I'd also recommend to list each tag in the "tags" root level openapi property. This isn't a requirement for OpenAPI, but it allows a styleguide validator to detect typos.

pvdbosch commented 8 months ago

SwaggerUI displays an operation multiple times for each of its tags, which is quite confusing. Maybe we should limit to max one tag on each operation?

pvdbosch commented 7 months ago

Conclusions REST WG:

I'll create a PR and create ticket to add rule to validator

pvdbosch commented 7 months ago

PR #171 ready for review

pvdbosch commented 5 months ago

PR has been merged and will be published next release.