Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enum and properties change in schemas not reported in .md file generated after diff check #523

Open
dattadebarshi opened this issue May 17, 2023 · 0 comments

Comments

@dattadebarshi
Copy link

Compared 2 API Specifications json. The Specification contains multiple component schemas. But if there is an Enum Array (same array) is present in different component schemas, then while publishing the diff for Rest Call only once the ENUM change is reported although multiple schema changes are applicable for that or other Rest Call with the same Enum Array list.

Similarly observed the same issue with properties change in Schema.

Sample for enum issue:

Old Spec:
{ "openapi": "3.0.1", "paths": { "/check/api/Id/Exp{ExpId}": { "get": { "responses": { "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExpRO" } } } } } } } }, "components": { "schemas": { "ExpRO": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/ExpDataRO" } } }, "ExpDataRO": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "tpeExpectations" ] }, "attributes": { "$ref": "#/components/schemas/ExpAttributesRO" } } }, "ExpAttributesRO": { "type": "object", "properties": { "Terminations": { "type": "array", "items": { "$ref": "#/components/schemas/TerminationRO" } } } }, "TerminationRO": { "type": "object", "properties": { "nniNetwork": { "$ref": "#/components/schemas/NetworkRO" }, "ponConnection": { "$ref": "#/components/schemas/PonConnectionRO" } } }, "NetworkRO": { "type": "object", "properties": { "tagAction": { "type": "string", "enum": [ "none", "pop", "push", "stamp" ] }, "floodingLink": { "type": "string", "enum": [ "enabled", "disabled" ] } } }, "PonConnectionRO": { "type": "object", "properties": { "tagAction": { "type": "string", "enum": [ "none", "pop", "push", "stamp" ] } } } } } }

New Spec:
{ "openapi": "3.0.1", "paths": { "/check/api/Id/Exp{ExpId}": { "get": { "responses": { "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExpRO" } } } } } } } }, "components": { "schemas": { "ExpRO": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/ExpDataRO" } } }, "ExpDataRO": { "type": "object", "properties": { "id": { "type": "string" }, "type": { "type": "string", "enum": [ "tpeExpectations" ] }, "attributes": { "$ref": "#/components/schemas/ExpAttributesRO" } } }, "ExpAttributesRO": { "type": "object", "properties": { "Terminations": { "type": "array", "items": { "$ref": "#/components/schemas/TerminationRO" } } } }, "TerminationRO": { "type": "object", "properties": { "NetworkConnectionPackage": { "$ref": "#/components/schemas/NetworkConnectionRO" }, "ponConnectionPackage": { "$ref": "#/components/schemas/PonConnectionRO" }, "datalinkPackage": { "$ref": "#/components/schemas/DatalinkRO" } } }, "NetworkConnectionRO": { "type": "object", "properties": { "tagAction": { "type": "string", "enum": [ "none", "pop", "push", "stamp" ] }, "floodingLink": { "type": "string", "enum": [ "enabled", "disabled" ] } } }, "PonConnectionRO": { "type": "object", "properties": { "tagAction": { "type": "string", "enum": [ "none", "pop", "push", "stamp" ] } } }, "DatalinkRO": { "type": "object", "properties": { "adminState": { "type": "string", "enum": [ "enabled", "disabled" ] } } } } } }

Diff md file:

What's Changed


GET /check/api/Id/Exp{ExpId}
Return Type:

Changed response : **default **

  • Changed content type : application/json

    • Changed property data (object)

      • Changed property attributes (object)

        • Changed property Terminations (array)

          Changed items (object):

          • Added property NetworkConnectionPackage (object)

            • Property tagAction (string)

              Enum values:

              • none
              • pop
              • push
              • stamp
            • Property floodingLink (string)

              Enum values:

              • enabled
              • disabled
          • Added property ponConnectionPackage (object)

            • Property tagAction (string)
          • Added property datalinkPackage (object)

            • Property adminState (string)
          • Deleted property nniNetwork (object)

          • Deleted property ponConnection (object)

Enum change not reported for datalinkPackage -> adminState and ponConnectionPackage -> tagAction

Sample for properties issue:

Old Spec:
{ "openapi": "3.0.1", "paths": { "/check/API": { "get": { "responses": { "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExpAPIRO" } } } } } } } }, "components": { "schemas": { "ExpAPIRO": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/ExpAPIDataRO" } } }, "ExpAPIDataRO": { "type": "object", "properties": { "relationships": { "$ref": "#/components/schemas/ExpAPIRelationshipsRO" } } }, "ExpAPIRelationshipsRO": { "type": "object", "properties": {} } } } }

New Spec:
{ "openapi": "3.0.1", "paths": { "/check/API": { "get": { "responses": { "default": { "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ExpAPIRO" } } } } } } } }, "components": { "schemas": { "ExpAPIRO": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/ExpAPIDataRO" } } }, "ExpAPIDataRO": { "type": "object", "properties": { "relationships": { "$ref": "#/components/schemas/ExpAPIRelationshipsRO" } } }, "ExpAPIRelationshipsRO": { "type": "object", "properties": { "linkedTpes": { "$ref": "#/components/schemas/OneToManyRelationshipRO" }, "shelfNetworkConstruct": { "$ref": "#/components/schemas/OneToOneRelationshipRO" } } }, "OneToManyRelationshipRO": { "type": "object", "properties": { "data": { "type": "array", "items": { "$ref": "#/components/schemas/RelationshipDataRO" } }, "meta": { "$ref": "#/components/schemas/RelationshipMetaDataRO" } } }, "RelationshipDataRO": { "type": "object", "properties": { "type": { "type": "string" }, "id": { "type": "string" }, "attributes": { "$ref": "#/components/schemas/RelationshipAttributesRO" } } }, "RelationshipAttributesRO": { "type": "object", "properties": { "additionalAttributes": { "$ref": "#/components/schemas/AdditionalAttributesRO" } } }, "AdditionalAttributesRO": { "type": "object" }, "RelationshipMetaDataRO": { "type": "object", "properties": { "partiallyPopulated": { "type": "boolean" } } }, "OneToOneRelationshipRO": { "type": "object", "properties": { "data": { "$ref": "#/components/schemas/RelationshipDataRO" }, "meta": { "$ref": "#/components/schemas/RelationshipMetaDataRO" } } } } } }

Diff md file:

What's Changed


GET /check/API
Return Type:

Changed response : **default **

  • Changed content type : application/json

    • Changed property data (object)

      • Changed property relationships (object)

        • Added property linkedTpes (object)

          • Property data (array)

            Items (object):

            • Property type (string)

            • Property id (string)

            • Property attributes (object)

              • Property additionalAttributes (object)
          • Property meta (object)

            • Property partiallyPopulated (boolean)
        • Added property shelfNetworkConstruct (object)

          • Property data (object)

          • Property meta (object)

Property change in shelfNetworkConstruct-> meta and shelfNetworkConstruct-> data not reported in MD file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant