Skip to content

Optimize and reduce duplicates during the Graph metadata OData to OpenAPI conversion. #913

Closed

Description

Actions in Graph are mapped for each path in the generated OpenAPI doc and each of these paths is associated with a request body and the response . The request bodies and responses are often duplicates

The Kiota generation using the OpenAPI v1.0 doc creates a model class for each of this request body and response which generates duplicate code.

Expectation:

Optimize and reduce the duplicates during the Graph OData to OpenAPI transformation.

Activity

  1. irvinesunday commented on Jun 23, 2022

    @irvinesunday
    Contributor

    The schema values within the Response objects of Actions are generated based on the return type of the action: null, collection, primitive or others.
    Even for those which have similar return types, e.g., collection, they have different $ref values in their schemas, e.g.,

    image

    vs

    image

    This might make it unfeasible to refactor out the responses into a reusable component by all Action responses.

    The same applies to the RequestBody; depending on whether an Action is bound or not, the schema will differ. For bound Actions, the parameters and their schemas will be added to the content property of the RequestBody e.g.,:

    image

    vs

    image

  2. baywet commented on Jun 27, 2022

    @baywet
    Member

    Closing in favor of microsoft/OpenAPI.NET.OData#241 as the work needs to happen in the conversion library.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions