OpenAPITools / OpenAPITools/openapi-diff
[2.1.0-beta.6 and oas-3.1.0] Request body property data type change is detected as compatible or no_change
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Java
- Sterne
- 1.1k
- Forks
- 190
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
- string to object (actual: compatible, expected: incompatible)
- string to integer/integer to string (actual: no_change, expected: incompatible)
Case 1:
old.yml
openapi: 3.1.0
info:
title: Demo API
version: v1
paths:
/endpoint:
post:
requestBody:
content:
application/json:
schema:
type: object
required:
- requiredProp
- requiredToRemoveProp
- dataTypeChangedRequiredProp
- requiredToOptionalProp
properties:
requiredProp:
type: string
optionalProp:
type: string
optionalToRemoveProp:
type: string
requiredToRemoveProp:
type: string
dataTypeChangedRequiredProp:
type: string
dataTypeChangedOptionalProp:
type: string
optionalToRequiredProp:
type: string
requiredToOptionalProp:
type: string
responses:
default:
description: successful operation
content:
application/json:
schema:
type: object
properties:
status:
type: integer
format: int64
example: 201
new.yml
openapi: 3.1.0
info:
title: Demo API
version: v1
paths:
/endpoint:
post:
requestBody:
content:
application/json:
schema:
type: object
required:
- requiredProp
- requiredToRemoveProp
- dataTypeChangedRequiredProp
- requiredToOptionalProp
properties:
requiredProp:
type: string
optionalProp:
type: string
optionalToRemoveProp:
type: string
requiredToRemoveProp:
type: string
dataTypeChangedRequiredProp:
type: object
properties:
id:
type: string
dataTypeChangedOptionalProp:
type: string
optionalToRequiredProp:
type: string
requiredToOptionalProp:
type: string
responses:
default:
description: successful operation
content:
application/json:
schema:
type: object
properties:
status:
type: integer
format: int64
example: 201
Case 2:
old.yml
openapi: 3.1.0
info:
title: Demo API
version: v1
paths:
/endpoint:
post:
requestBody:
content:
application/json:
schema:
type: object
required:
- requiredProp
- requiredToRemoveProp
- dataTypeChangedRequiredProp
- requiredToOptionalProp
properties:
requiredProp:
type: string
optionalProp:
type: string
optionalToRemoveProp:
type: string
requiredToRemoveProp:
type: string
dataTypeChangedRequiredProp:
type: integer
dataTypeChangedOptionalProp:
type: string
optionalToRequiredProp:
type: string
requiredToOptionalProp:
type: string
responses:
default:
description: successful operation
content:
application/json:
schema:
type: object
properties:
status:
type: integer
format: int64
example: 201
new.yml
openapi: 3.1.0
info:
title: Demo API
version: v1
paths:
/endpoint:
post:
requestBody:
content:
application/json:
schema:
type: object
required:
- requiredProp
- requiredToRemoveProp
- dataTypeChangedRequiredProp
- requiredToOptionalProp
properties:
requiredProp:
type: string
optionalProp:
type: string
optionalToRemoveProp:
type: string
requiredToRemoveProp:
type: string
dataTypeChangedRequiredProp:
type: string
dataTypeChangedOptionalProp:
type: string
optionalToRequiredProp:
type: string
requiredToOptionalProp:
type: string
responses:
default:
description: successful operation
content:
application/json:
schema:
type: object
properties:
status:
type: integer
format: int64
example: 201
Examples are having data-type change only for required property but tested the same for optional property giving same output
Command used: docker run --rm -t -v $(pwd):/specs openapitools/openapi-diff:2.1.0-beta.6 /specs/old.yml /specs/new.yml --state
EDIT: The same changes are considered as incompatible with openapi: 3.0.3 and below
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, den Bericht mit old.yml und new.yml unter Verwendung des angegebenen openapi-diff-Docker-Befehls zu reproduzieren und die Ergebnisse von OpenAPI 3.1.0 mit dem Verhalten von 3.0.3 zu vergleichen. Verfolge den Vergleich des Typs des Request-Body-Schemas und füge Regressionstests für Änderungen von string/object und string/integer hinzu; abgeschlossen ist die Aufgabe, wenn diese Änderungen als inkompatibel gemeldet werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- java
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 38/100