-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixes #154 splite openapi-meta to move specification parser to openap…
…i-helper (#155)
- Loading branch information
Showing
13 changed files
with
1,277 additions
and
1 deletion.
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,62 @@ | ||
<!-- | ||
~ Copyright (c) 2016 Network New Technologies Inc. | ||
~ | ||
~ Licensed under the Apache License, Version 2.0 (the "License"); | ||
~ you may not use this file except in compliance with the License. | ||
~ You may obtain a copy of the License at | ||
~ | ||
~ http://www.apache.org/licenses/LICENSE-2.0 | ||
~ | ||
~ Unless required by applicable law or agreed to in writing, software | ||
~ distributed under the License is distributed on an "AS IS" BASIS, | ||
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
~ See the License for the specific language governing permissions and | ||
~ limitations under the License. | ||
--> | ||
|
||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.networknt</groupId> | ||
<artifactId>light-rest-4j</artifactId> | ||
<version>2.0.22-SNAPSHOT</version> | ||
<relativePath>..</relativePath> | ||
</parent> | ||
|
||
<artifactId>openapi-helper</artifactId> | ||
<packaging>jar</packaging> | ||
<description>An OpenAPI Specification 3.0 helper to cache the spec for other component to use</description> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.networknt</groupId> | ||
<artifactId>json-overlay</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.networknt</groupId> | ||
<artifactId>openapi-parser</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
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,293 @@ | ||
{ | ||
"openapi": "3.0.0", | ||
"info": { | ||
"version": "1.0.0", | ||
"title": "Swagger Petstore", | ||
"license": { | ||
"name": "MIT" | ||
} | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://petstore.swagger.io/v1" | ||
} | ||
], | ||
"paths": { | ||
"/pets": { | ||
"get": { | ||
"summary": "List all pets", | ||
"operationId": "listPets", | ||
"tags": [ | ||
"pets" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "limit", | ||
"in": "query", | ||
"description": "How many items to return at one time (max 100)", | ||
"required": false, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int32" | ||
} | ||
} | ||
], | ||
"security": [ | ||
{ | ||
"petstore_auth": [ | ||
"read:pets" | ||
] | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "An paged array of pets", | ||
"headers": { | ||
"x-next": { | ||
"description": "A link to the next page of responses", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
}, | ||
"example": [ | ||
{ | ||
"id": 1, | ||
"name": "catten", | ||
"tag": "cat" | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "doggy", | ||
"tag": "dog" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"default": { | ||
"description": "unexpected error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"summary": "Create a pet", | ||
"operationId": "createPets", | ||
"requestBody": { | ||
"description": "Pet to add to the store", | ||
"required": true, | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
}, | ||
"tags": [ | ||
"pets" | ||
], | ||
"security": [ | ||
{ | ||
"petstore_auth": [ | ||
"read:pets", | ||
"write:pets" | ||
] | ||
} | ||
], | ||
"responses": { | ||
"201": { | ||
"description": "Null response" | ||
}, | ||
"default": { | ||
"description": "unexpected error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/pets/{petId}": { | ||
"get": { | ||
"summary": "Info for a specific pet", | ||
"operationId": "showPetById", | ||
"tags": [ | ||
"pets" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "petId", | ||
"in": "path", | ||
"required": true, | ||
"description": "The id of the pet to retrieve", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"security": [ | ||
{ | ||
"petstore_auth": [ | ||
"read:pets" | ||
] | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Expected response to a valid request", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Pet" | ||
}, | ||
"example": { | ||
"id": 1, | ||
"name": "Jessica Right", | ||
"tag": "pet" | ||
} | ||
} | ||
} | ||
}, | ||
"default": { | ||
"description": "unexpected error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"delete": { | ||
"summary": "Delete a specific pet", | ||
"operationId": "deletePetById", | ||
"tags": [ | ||
"pets" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "petId", | ||
"in": "path", | ||
"required": true, | ||
"description": "The id of the pet to delete", | ||
"schema": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"name": "key", | ||
"in": "header", | ||
"required": true, | ||
"description": "The key header", | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"security": [ | ||
{ | ||
"petstore_auth": [ | ||
"write:pets" | ||
] | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "Expected response to a valid request", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Pet" | ||
} | ||
} | ||
} | ||
}, | ||
"default": { | ||
"description": "unexpected error", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Error" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"securitySchemes": { | ||
"petstore_auth": { | ||
"type": "oauth2", | ||
"description": "This API uses OAuth 2 with the client credential grant flow.", | ||
"flows": { | ||
"clientCredentials": { | ||
"tokenUrl": "https://localhost:6882/token", | ||
"scopes": { | ||
"write:pets": "modify pets in your account", | ||
"read:pets": "read your pets" | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"schemas": { | ||
"Pet": { | ||
"required": [ | ||
"id", | ||
"name" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "integer", | ||
"format": "int64" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"tag": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"Error": { | ||
"required": [ | ||
"code", | ||
"message" | ||
], | ||
"properties": { | ||
"code": { | ||
"type": "integer", | ||
"format": "int32" | ||
}, | ||
"message": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.