-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove dependency scan for inputSpec (actually not required) (#19084)
* added test with external-ref ("external dependency" installed before actual usage) * fixed test with resource on classpath added test with resource on classpath with external-ref. Test with profile 'resource' was wrong as it took JAR into account, but there was no 'petstore.yaml' on classpath. * Remove dependency scan and do not modify inputSpec provided by user It is still possible to provide JARs as inputSpec, however the user has to provide it by hand. Providing dependencies in plugin section still allows correct inputSpec resolution on classpath.
- Loading branch information
Showing
14 changed files
with
938 additions
and
44 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
13 changes: 13 additions & 0 deletions
13
...s/openapi-generator-maven-plugin/examples/multi-module/sample-external-ref-schema/pom.xml
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,13 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
|
||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>org.openapitools</groupId> | ||
<artifactId>sample-external-ref-schema</artifactId> | ||
<packaging>jar</packaging> | ||
<version>1.0-SNAPSHOT</version> | ||
<name>sample-external-ref-schema</name> | ||
<url>https://maven.apache.org</url> | ||
|
||
<!-- this POM is not a module of multi-module project to keep resources out of classpath--> | ||
|
||
</project> |
105 changes: 105 additions & 0 deletions
105
...les/multi-module/sample-external-ref-schema/src/main/resources/external-ref/petstore.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,105 @@ | ||
openapi: 3.0.0 | ||
servers: | ||
- url: 'http://petstore.swagger.io/v2' | ||
info: | ||
description: Sample file with just two endpoints and one schema (defined in an external file $ref) | ||
version: 1.0.0 | ||
title: OpenAPI Petstore | ||
paths: | ||
/pet: | ||
post: | ||
tags: | ||
- pet | ||
summary: Add a new pet to the store | ||
description: '' | ||
operationId: addPet | ||
responses: | ||
'200': | ||
description: successful operation | ||
content: | ||
application/xml: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
'405': | ||
description: Invalid input | ||
security: | ||
- petstore_auth: | ||
- 'write:pets' | ||
- 'read:pets' | ||
requestBody: | ||
$ref: '#/components/requestBodies/Pet' | ||
'/pet/{petId}': | ||
get: | ||
tags: | ||
- pet | ||
summary: Find pet by ID | ||
description: Returns a single pet | ||
operationId: getPetById | ||
parameters: | ||
- name: petId | ||
in: path | ||
description: ID of pet to return | ||
required: true | ||
schema: | ||
type: integer | ||
format: int64 | ||
responses: | ||
'200': | ||
description: successful operation | ||
content: | ||
application/xml: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
'400': | ||
description: Invalid ID supplied | ||
'404': | ||
description: Pet not found | ||
security: | ||
- api_key: [] | ||
delete: | ||
tags: | ||
- pet | ||
summary: Deletes a pet | ||
description: '' | ||
operationId: deletePet | ||
parameters: | ||
- name: api_key | ||
in: header | ||
required: false | ||
schema: | ||
type: string | ||
- name: petId | ||
in: path | ||
description: Pet id to delete | ||
required: true | ||
schema: | ||
type: integer | ||
format: int64 | ||
responses: | ||
'400': | ||
description: Invalid pet value | ||
security: | ||
- petstore_auth: | ||
- 'write:pets' | ||
- 'read:pets' | ||
components: | ||
requestBodies: | ||
Pet: | ||
content: | ||
application/json: | ||
schema: | ||
$ref: 'schemas/Pet.yaml' | ||
application/xml: | ||
schema: | ||
$ref: 'schemas/Pet.yaml' | ||
description: Pet object that needs to be added to the store | ||
required: true | ||
schemas: | ||
Pet: | ||
$ref: 'schemas/Pet.yaml' |
29 changes: 29 additions & 0 deletions
29
.../multi-module/sample-external-ref-schema/src/main/resources/external-ref/schemas/Pet.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 @@ | ||
title: a Pet | ||
description: A pet for sale in the pet store | ||
type: object | ||
required: | ||
- name | ||
- photoUrls | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
example: doggie | ||
photoUrls: | ||
type: array | ||
xml: | ||
name: photoUrl | ||
wrapped: true | ||
items: | ||
type: string | ||
status: | ||
type: string | ||
description: pet status in the store | ||
enum: | ||
- available | ||
- pending | ||
- sold | ||
xml: | ||
name: Pet |
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
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
Oops, something went wrong.