Skip to content

Duplicate operationIds in OpenAPI schema #1600

@alilleybrinker

Description

@alilleybrinker

Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:
    • Checked the FAQs on the message board for common solutions: (TBD)
    • Checked that your issue isn't already filed.

Description

The OpenAPI specification for cve-services is technically not spec-compliant with the new registry endpoints included, as the registry endpoints share identical operationIds with their non-registry counterparts.

I encountered this while trying to use progenitor, a Rust library, to generate a consumer for the CVE Services API based on the OpenAPI spec. Progenitor recognizes the error and bails out.

The solution would be to assign different operationIds for the registry endpoints from their legacy counterparts.

Steps to Reproduce

Attempt to compile a Rust crate using progenitor as a dependency and with the following call in the Rust source:

progenitor::generate_api!("api/cve-services-api.json");

Replacing the "api/cve-services-api.json" path with the appropriate path to a local copy of the CVE Services OpenAPI specification.

Expected behavior:

Progenitor should be able to generate a valid consumer for the CVE Services API based on the API specification.

Actual behavior:

Progenitor fails with the following error, indicating the existence of duplicate operationIds:

error: generation error for api/cve-services-api.json: unexpected or unhandled format in the OpenAPI document duplicate operation ID: orgUpdateSingle
 --> src/main.rs:1:27
  |
1 | progenitor::generate_api!("api/cve-services-api.json");
  |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^

Reproduces how often:

Reproduces every time compilation is attempted with progenitor on the latest version of the CVE Services OpenAPI specification.

Versions

Latest development version.

Additional Information

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions