-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: added test for verifying changed component section identification
- Loading branch information
1 parent
571a7a1
commit dc5589a
Showing
3 changed files
with
165 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"title": "Test API", | ||
"description": "A sample API for testing" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "https://api.example.com/v1" | ||
} | ||
], | ||
"paths": { | ||
"/user/{id}": { | ||
"get": { | ||
"summary": "Get user by ID", | ||
"parameters": [ | ||
{ | ||
"$ref": "#/components/parameters/StringUserId" | ||
}, | ||
{ | ||
"$ref": "#/components/parameters/NumberUserId" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "User found", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"userCreated": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/User" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"parameters": { | ||
"StringUserId": { | ||
"type": "string", | ||
"description": "The unique identifier for a user", | ||
"example": 1234 | ||
}, | ||
"NumberUserId": { | ||
"type": "number", | ||
"description": "The unique identifier for a user", | ||
"example": 1234 | ||
} | ||
}, | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"email": { | ||
"$ref": "#/components/schemas/Email" | ||
} | ||
} | ||
}, | ||
"Email": { | ||
"type": "string", | ||
"format": "email" | ||
} | ||
} | ||
} | ||
} |
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,4 @@ | ||
## Modified | ||
- [GET] `/user/{id}` | ||
- `NumberUserId` modified in parameters | ||
- `User` modified in responses |
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,80 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"title": "Test API", | ||
"description": "A sample API for testing" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "https://api.example.com/v1" | ||
} | ||
], | ||
"paths": { | ||
"/user/{id}": { | ||
"get": { | ||
"summary": "Get user by ID", | ||
"parameters": [ | ||
{ | ||
"$ref": "#/components/parameters/StringUserId" | ||
}, | ||
{ | ||
"$ref": "#/components/parameters/NumberUserId" | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "User found", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "object", | ||
"properties": { | ||
"userCreated": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/User" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"parameters": { | ||
"StringUserId": { | ||
"type": "string", | ||
"description": "The unique identifier for a user", | ||
"example": 1234 | ||
}, | ||
"NumberUserId": { | ||
"type": "number", | ||
"description": "The unique identifier for a user", | ||
"example": 12345 | ||
} | ||
}, | ||
"schemas": { | ||
"User": { | ||
"type": "object", | ||
"properties": { | ||
"id": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"email": { | ||
"$ref": "#/components/schemas/Email" | ||
} | ||
} | ||
}, | ||
"Email": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} |