Skip to content

Push Extensible interface up the model hierarchy #973

Description

@EricWittmann

Currently, the Extensible interface is only accessible through version-specific interfaces (e.g.,
OpenApi30Info extends OpenApi30Extensible). This means users must cast to version-specific types to
work with extensions:

OpenApi30Info info = (OpenApi30Info) document.getInfo();
info.getExtensions();

The Extensible interface should be pushed up the common model hierarchy so that it is available on
shared interfaces like Info, Operation, PathItem, etc. This would allow a more natural API:

((Extensible) document.getInfo()).getExtensions();

Or ideally, if Info itself extended Extensible:

document.getInfo().getExtensions();

This is a code generator improvement — the unified model generator needs to correctly propagate common
interfaces like Extensible up the data model hierarchy.

Originally discussed in #678.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/openapiIssues related to the OpenAPI specification.priority/normalIssues with default priority - these are important and interesting but can be worked on in due time.type/enhancementIssues that represent requests for new features.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions