Skip to content

Backward compatibility with different OtG versions #335

Open
@Alan-Cha

Description

@Alan-Cha

Currently, we do not guarantee that generated field names or type names will stay the same across different versions of OtG. The same OAS may also produce different field names or type names if the operations are ordered different as the GraphQL interface is built up incrementally.

We need to find a way that will allow us to guarantee that field names and type names will stay the same regardless of input or package version.


Currently, the option operationIdFieldNames allows the user to manually override field name generation. I think there is potential in outputting an edited OAS that replaces the operationIds with the generated field names. That way, a user can use the operationIdFieldName option to guarantee the same field names across different versions of OtG.

However, this may not always be an option as a user might be working with a generated OAS.


Alternatively, we can output an object that contains the mapping from operation method, operation path, and HTTP status (relating to a single response body) to field name and schema to type name. This object can also be consumed to allow us to generate more consistent interfaces.

Another consideration we may have to make is storing the field names for linked operations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions