Skip to content
This repository was archived by the owner on Nov 8, 2024. It is now read-only.
This repository was archived by the owner on Nov 8, 2024. It is now read-only.

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

Open
@kylef

Description

@kylef

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopenapi3

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions