-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding test case for Issue #77. Fixing an issue where an except…
…ion was thrown when resolving the main contract. Signed-off-by: Gerrett <[email protected]>
- Loading branch information
1 parent
b0247f6
commit 8216533
Showing
6 changed files
with
188 additions
and
7 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
46 changes: 46 additions & 0 deletions
46
src/test/resources/io/vertx/openapi/contract/additional_schema_files/dereferenced.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,46 @@ | ||
{ | ||
"components": { | ||
"schemas": { | ||
"RequestBody": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"$ref": "https://schemas/Name.yaml" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"openapi": "3.1.0", | ||
"paths": { | ||
"/v1/post": { | ||
"post": { | ||
"summary": "Some POST request", | ||
"requestBody": { | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "app:///#/components/schemas/RequestBody" | ||
} | ||
} | ||
} | ||
}, | ||
"operationId": "postBody", | ||
"responses": { | ||
"200": { | ||
"description": "Success" | ||
}, | ||
"default": { | ||
"description": "An unexpected error occurred" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"info": { | ||
"title": "My Service", | ||
"version": "1.0.0" | ||
}, | ||
"tags": [] | ||
} |
5 changes: 5 additions & 0 deletions
5
src/test/resources/io/vertx/openapi/contract/additional_schema_files/name.yaml
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,5 @@ | ||
$schema: https://spec.openapis.org/oas/3.1/dialect/base | ||
description: A case-insensitive string of 1-255 characters, serving as a name (unique identifier) | ||
type: string | ||
minLength: 1 | ||
maxLength: 255 |
29 changes: 29 additions & 0 deletions
29
src/test/resources/io/vertx/openapi/contract/additional_schema_files/openapi.yaml
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,29 @@ | ||
openapi: 3.1.0 | ||
info: | ||
title: My Service | ||
version: 1.0.0 | ||
tags: [] | ||
paths: | ||
/v1/post: | ||
post: | ||
summary: Some POST request | ||
operationId: postBody | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/RequestBody' | ||
responses: | ||
200: | ||
description: Success | ||
default: | ||
description: An unexpected error occurred | ||
components: | ||
schemas: | ||
RequestBody: | ||
type: object | ||
properties: | ||
name: | ||
description: The unique name of the object | ||
$ref: 'https://schemas/Name.yaml' |
51 changes: 51 additions & 0 deletions
51
src/test/resources/io/vertx/openapi/contract/split/validJsonSchemaComponents.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,51 @@ | ||
{ | ||
"$id": "petstore", | ||
"openapi": "3.1.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Swagger Petstore", | ||
"license": { | ||
"identifier": "MIT", | ||
"name": "MIT License" | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Pet": { | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"name" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"Error": { | ||
"type": "object", | ||
"required": [ | ||
"code", | ||
"message" | ||
], | ||
"properties": { | ||
"code": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"message": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |