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

Embed map key type information #32

Open
msrd0 opened this issue Feb 3, 2022 · 0 comments
Open

Embed map key type information #32

msrd0 opened this issue Feb 3, 2022 · 0 comments

Comments

@msrd0
Copy link
Owner

msrd0 commented Feb 3, 2022

With OpenAPI 3.0, there is no way to include map key type information in the schema. However, this changes with OpenAPI 3.1, where keys are still assumed as strings (which is unfortunate but understandable since it targets JSON), but can be specified as a pattern.

I thought about limiting the accepted key types to some known ones that we can provide a pattern for, but I don't really like that idea. So maybe this will not be possible before (a) the openapiv3 crate (or another, similar crate) adds support for 3.1 and (b) Rust stabilises specialisation, so we can add patterns for known types but keep support for "unknown" types.

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

No branches or pull requests

1 participant