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

Prevent duplicate IDs from being used in OAS 3 parser #330

Open
kylef opened this issue Aug 16, 2019 · 0 comments
Open

Prevent duplicate IDs from being used in OAS 3 parser #330

kylef opened this issue Aug 16, 2019 · 0 comments
Labels
bug Something isn't working openapi3

Comments

@kylef
Copy link
Member

kylef commented Aug 16, 2019

The OAS 3 parser has an internal context which includes a method registerId() which can be used to register IDs which are placed in the API Elements parse result. This function is used to know if the IDs are unique. There are a couple of problems with the current implementation:

  • registerId is not used everywhere
  • we should implement erroring out when duplicate ID is used, it may be possible to write as OAS 3 document which contains the multiple elements with the same ID (security definition and schema sharing same name).
  • Certain IDs are unfortunately not possible due to how API Elements works and we must either escape or prevent using known element names as an ID. For example if the ID was httpRequest, string, resource, category etc, this would clash with the already existing element names.

This problem likely applies to API Blueprint and the OAS 2 parser too.

@kylef kylef added bug Something isn't working openapi3 labels Aug 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi3
Projects
None yet
Development

No branches or pull requests

1 participant