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

Inline Serializer - RFC3986-compliant #685

Closed
nathanmrtns opened this issue Mar 18, 2022 · 2 comments
Closed

Inline Serializer - RFC3986-compliant #685

nathanmrtns opened this issue Mar 18, 2022 · 2 comments
Labels
enhancement New feature or request fix confirmation pending issue has been fixed and confirmation from issue reporter is pending

Comments

@nathanmrtns
Copy link

Describe the bug
Using inline_serializer(name="Name with spaces"...) generates a component schema like Name with spaces:

components:
  schemas:
    Name with spaces:

Running the validate command, doesn't show any warnings about this, but if I paste the yml file into swagger editor, it complains about $ref values must be RFC3986-compliant percent-encoded URIs

A suggestion would be that the rfc compliant name wouldn't be required but we could show some warnings.
wdyt?

To Reproduce
Just use inline_serializer with name attribute with spaces.
Generate schema
Use the schema in swagger editor

Expected behavior
The editor show RFC Compliant errors

tfranzel added a commit that referenced this issue Mar 18, 2022
@tfranzel
Copy link
Owner

tfranzel commented Mar 18, 2022

Running the validate command, doesn't show any warnings about this, but if I paste the yml file into swagger editor, it complains about $ref values must be RFC3986-compliant percent-encoded URIs

that is unexpected but entirely possible. The meta schema for OpenAPI on which the validation operates is not 100%.

Semantic error at components.schemas.Name with spaces
Component names can only contain the characters A-Z a-z 0-9 - . _

This must even be stricter than RFC3986. The issue with the ref is just a consequence of the invalid name. So quoting isn't an option either. We now emit a warning if names are bogus.

Good find! thx

@tfranzel tfranzel added enhancement New feature or request fix confirmation pending issue has been fixed and confirmation from issue reporter is pending labels Mar 18, 2022
@tfranzel
Copy link
Owner

closing this issue for now. feel free to comment if anything is missing or not working and we will follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix confirmation pending issue has been fixed and confirmation from issue reporter is pending
Projects
None yet
Development

No branches or pull requests

2 participants