OpenAPITools / OpenAPITools/openapi-diff
Schema description update should be considered as a metadata change
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.1k
- Forks
- 190
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
When diffing this spec:
openapi: 3.0.3
info:
title: Test
paths:
/foo:
post:
requestBody:
content:
application/json:
schema:
type: string
description: desc v1
with this one:
openapi: 3.0.3
info:
title: Test
paths:
/foo:
post:
requestBody:
content:
application/json:
schema:
type: string
description: desc v2
I get the following output:
==========================================================================
== API CHANGE LOG ==
==========================================================================
Test
--------------------------------------------------------------------------
-- What's Changed --
--------------------------------------------------------------------------
- POST /foo
Request:
- Changed application/json
Schema: Backward compatible
--------------------------------------------------------------------------
-- Result --
--------------------------------------------------------------------------
API changes are backward compatible
--------------------------------------------------------------------------
Since only the description field changed, I would expect a "metadata" change instead of a "compatible" one.
Changes to the description are correctly marked as metadata ones internally (see here and here) but I suspect the final value that is picked up to be the default one returned here. I don't have the time or means to debug it further however.
Tested version: 2.1.0-beta.11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the supplied OpenAPI diff, then inspect core/src/main/java/org/openapitools/openapidiff/core/model/ChangedSchema.java around the referenced line 160, alongside ChangedMetadata.java and the metadata handling in ChangedSchema.java. Done means a schema description-only change is reported as a metadata change rather than merely backward compatible.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100