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

Add fqn_for_swagger_name option #881

Merged
merged 1 commit into from
Mar 1, 2019

Conversation

hypnoce
Copy link
Contributor

@hypnoce hypnoce commented Feb 28, 2019

Problem :
Name generation can output unreadable concatenation. It is also dependent on the unicity, which can completely change the documentation by adding one message. It is a big side effect.

To have a more repeatable name generation as well as to ensure unicity and readability, generate swagger name as a dot-separated concatenation for proto fully qualified name.

Can help fix #877

…rated concatenation for proto fully qualified name.
@johanbrandhorst
Copy link
Collaborator

Nice work, complete with tests and all 😍! I'm just wondering, have you explored what the standard way of namespacing things is in the OpenAPI/swagger world? It might be we might want to do a little research before merging this to see if there's another alternative representation that might be better. In any case, this is a backwards-compatible change so I have no real objections.

@hypnoce
Copy link
Contributor Author

hypnoce commented Feb 28, 2019

Indeed, always trying to keep things backward compatible.
Let me research things to see if we can have a more 'swagger' way of namespacing.

@hypnoce
Copy link
Contributor Author

hypnoce commented Mar 1, 2019

Hi,

after some search, the only thing that is the closest to package/namespace if the xml namespace/prefix. Also, the swagger code gen has a specific option for generated package : https://github.com/swagger-api/swagger-codegen/tree/master/modules/swagger-codegen-maven-plugin. I believe their is no good support for namespaces/package in openapi 2 (as well as 3)

Thanks !

@johanbrandhorst johanbrandhorst merged commit 0c2b3b1 into grpc-ecosystem:master Mar 1, 2019
@johanbrandhorst
Copy link
Collaborator

SGTM, thanks for this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleaner Swagger-generated schema names (omitting prefixes)
3 participants