- changed title to changing a property in the response schema from required to non-required shows as breaking change and shows as if the property is being added
issue with changing a property from required to non-required in the response (and request) schema
Issue #38
new
I am trying to make a change from required to non-required in a response schema. I removed from dataCurrentContract
So this is how I am passing values to diffSpecs:
dataReferenceContract - existing spec
dataCurrentContract - new spec
result = await openapiDiff.diffSpecs({
sourceSpec: {
content: dataReferenceContract,
location: referenceContract,
format: 'openapi3'
},
destinationSpec: {
content: dataCurrentContract,
location: currentContract,
format: 'openapi3'
}
});
but the result is as if I am adding something
{
breakingDifferences: [
{
type: 'breaking',
action: 'add',
code: 'response.body.scope.add',
destinationSpecEntityDetails: [Array],
entity: 'response.body.scope',
source: 'json-schema-diff',
sourceSpecEntityDetails: [Array],
details: [Object]
},
{
type: 'breaking',
action: 'add',
code: 'response.body.scope.add',
destinationSpecEntityDetails: [Array],
entity: 'response.body.scope',
source: 'json-schema-diff',
sourceSpecEntityDetails: [Array],
details: [Object]
},
{
type: 'breaking',
action: 'add',
code: 'response.body.scope.add',
destinationSpecEntityDetails: [Array],
entity: 'response.body.scope',
source: 'json-schema-diff',
sourceSpecEntityDetails: [Array],
details: [Object]
}
],
breakingDifferencesFound: true,
nonBreakingDifferences: [],
unclassifiedDifferences: []
}
Comments (7)
-
reporter -
reporter I also did it in a request schema (making a property as non-required from being required) but the result I am getting is as if a property is being added
{ breakingDifferences: [ { type: 'breaking', action: 'add', code: 'response.body.scope.add', destinationSpecEntityDetails: [Array], entity: 'response.body.scope', source: 'json-schema-diff', sourceSpecEntityDetails: [Array], details: [Object] }, { type: 'breaking', action: 'add', code: 'response.body.scope.add', destinationSpecEntityDetails: [Array], entity: 'response.body.scope', source: 'json-schema-diff', sourceSpecEntityDetails: [Array], details: [Object] } ], breakingDifferencesFound: true, nonBreakingDifferences: [ { type: 'non-breaking', action: 'add', code: 'request.body.scope.add', destinationSpecEntityDetails: [Array], entity: 'request.body.scope', source: 'json-schema-diff', sourceSpecEntityDetails: [Array], details: [Object] }, { type: 'non-breaking', action: 'add', code: 'request.body.scope.add', destinationSpecEntityDetails: [Array], entity: 'request.body.scope', source: 'json-schema-diff', sourceSpecEntityDetails: [Array], details: [Object] } ], unclassifiedDifferences: [] }
-
reporter - changed title to issue with changing a property from required to non-required in the response (and request) schema
-
reporter - edited description
-
reporter - changed status to open
changed status to open to make it's way the lists
-
reporter - changed status to new
-
reporter any news on this please?
- Log in to comment