-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from abdelfetah18/openapi_comparator
Implement an OpenAPIComparator
- Loading branch information
Showing
89 changed files
with
14,520 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...c/test/resources/petstore/added-operation-callback/petstore-added-operation-callback.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "Simple Pet Store API", | ||
"version": "1.0.0" | ||
}, | ||
"paths": { | ||
"/pets": { | ||
"post": { | ||
"summary": "Add a new pet", | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"description": "Pet created successfully." | ||
} | ||
}, | ||
"callbacks": { | ||
"onPetStatusChange": { | ||
"{$request.body#/callbackUrl}": { | ||
"post": { | ||
"summary": "Notify about pet status change", | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"status": { | ||
"type": "string" | ||
}, | ||
"timestamp": { | ||
"type": "string", | ||
"format": "date-time" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "Callback successfully processed." | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
openapi-comparator-tests/src/test/resources/petstore/added-operation-callback/petstore.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"openapi": "3.0.3", | ||
"info": { | ||
"title": "Simple Pet Store API", | ||
"version": "1.0.0" | ||
}, | ||
"paths": { | ||
"/pets": { | ||
"post": { | ||
"summary": "Add a new pet", | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"description": "Pet created successfully." | ||
} | ||
}, | ||
"callbacks": {} | ||
} | ||
} | ||
} | ||
} |
133 changes: 133 additions & 0 deletions
133
...omparator-tests/src/test/resources/petstore/added-operation/petstore-added-operation.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "Sample Pet Store App", | ||
"summary": "A pet store manager.", | ||
"description": "This is a sample server for a pet store.", | ||
"termsOfService": "https://example.com/terms/", | ||
"contact": { | ||
"name": "API Support", | ||
"url": "https://www.example.com/support", | ||
"email": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "Apache 2.0", | ||
"url": "https://www.apache.org/licenses/LICENSE-2.0.html" | ||
}, | ||
"version": "1.0.3" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://petstore.swagger.io/v1" | ||
} | ||
], | ||
"paths": { | ||
"/pets": { | ||
"get": { | ||
"operationId": "getPets", | ||
"description": "Gets all pets", | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"operationId": "addPet", | ||
"description": "Add a new pet", | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/NewPet" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"201": { | ||
"description": "Pet created", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/pets/{petId}": { | ||
"get": { | ||
"operationId": "getPetById", | ||
"description": "Get a pet by its ID", | ||
"parameters": [ | ||
{ | ||
"name": "petId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"description": "The ID of the pet to retrieve" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Successful response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
}, | ||
"404": { | ||
"description": "Pet not found" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Pet": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"NewPet": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
} | ||
}, | ||
"required": [ | ||
"name" | ||
] | ||
} | ||
} | ||
} | ||
} |
96 changes: 96 additions & 0 deletions
96
openapi-comparator-tests/src/test/resources/petstore/added-operation/petstore.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "Sample Pet Store App", | ||
"summary": "A pet store manager.", | ||
"description": "This is a sample server for a pet store.", | ||
"termsOfService": "https://example.com/terms/", | ||
"contact": { | ||
"name": "API Support", | ||
"url": "https://www.example.com/support", | ||
"email": "[email protected]" | ||
}, | ||
"license": { | ||
"name": "Apache 2.0", | ||
"url": "https://www.apache.org/licenses/LICENSE-2.0.html" | ||
}, | ||
"version": "1.0.2" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://petstore.swagger.io/v1" | ||
} | ||
], | ||
"paths": { | ||
"/pets": { | ||
"get": { | ||
"operationId": "getPets", | ||
"description": "Gets all pets", | ||
"responses": { | ||
"200": { | ||
"description": "Success", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/pets/{petId}": { | ||
"get": { | ||
"operationId": "getPetById", | ||
"description": "Get a pet by its ID", | ||
"parameters": [ | ||
{ | ||
"name": "petId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"description": "The ID of the pet to retrieve" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Successful response", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
}, | ||
"404": { | ||
"description": "Pet not found" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Pet": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"name": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.