-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e829981
commit a50bb7e
Showing
14 changed files
with
463 additions
and
33 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
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
128 changes: 128 additions & 0 deletions
128
multiapi-engine/src/test/resources/openapigenerator/testIssueFaker/api-test.yml
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,128 @@ | ||
openapi: 3.0.2 | ||
info: | ||
title: Faker API Service | ||
version: "1.0" | ||
servers: | ||
- url: https://localhost/v1 | ||
paths: | ||
/faker/generate-schemas: | ||
post: | ||
tags: | ||
- SchemaGenerator | ||
operationId: generateSchema | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Configuration' | ||
responses: | ||
'200': | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/FakerSchema' | ||
'400': | ||
description: Bad Request | ||
'404': | ||
description: Not found | ||
|
||
components: | ||
schemas: | ||
Schema: | ||
type: object | ||
required: | ||
- subjectName | ||
- name | ||
properties: | ||
id: | ||
type: string | ||
subjectName: | ||
type: string | ||
name: | ||
type: string | ||
type: | ||
type: string | ||
original: | ||
type: boolean | ||
requiredFields: | ||
type: array | ||
items: | ||
type: string | ||
properties: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Field' | ||
definitions: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/Field' | ||
FakerSchema: | ||
type: object | ||
required: | ||
- subjectName | ||
- name | ||
- value | ||
properties: | ||
id: | ||
type: string | ||
subjectName: | ||
type: string | ||
name: | ||
type: string | ||
type: | ||
type: string | ||
original: | ||
type: boolean | ||
requiredFields: | ||
type: array | ||
items: | ||
type: string | ||
properties: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/FakerField' | ||
definitions: | ||
type: array | ||
items: | ||
$ref: '#/components/schemas/FakerField' | ||
FakerField: | ||
type: object | ||
required: | ||
- name | ||
- type | ||
- value | ||
properties: | ||
name: | ||
type: string | ||
type: | ||
type: string | ||
value: | ||
type: object | ||
Field: | ||
type: object | ||
required: | ||
- name | ||
- type | ||
properties: | ||
name: | ||
type: string | ||
type: | ||
type: string | ||
|
||
Configuration: | ||
type: object | ||
properties: | ||
configuration: | ||
type: object | ||
additionalProperties: | ||
type: number | ||
example: | ||
"ES": 0.8 | ||
"US": 0.2 | ||
numberToGenerate: | ||
type: integer | ||
example: 100 | ||
schema: | ||
$ref: '#/components/schemas/Schema' |
49 changes: 49 additions & 0 deletions
49
multiapi-engine/src/test/resources/openapigenerator/testIssueFaker/assets/FakerApi.java
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,49 @@ | ||
package com.sngular.multifileplugin.testissuefaker; | ||
|
||
import java.util.Optional; | ||
import java.util.List; | ||
import java.util.Map; | ||
import javax.validation.Valid; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.Parameter; | ||
import io.swagger.v3.oas.annotations.media.Content; | ||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import io.swagger.v3.oas.annotations.responses.ApiResponse; | ||
import org.springframework.http.MediaType; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
import org.springframework.web.context.request.NativeWebRequest; | ||
|
||
import com.sngular.multifileplugin.testissuefaker.model.ConfigurationDTO; | ||
import com.sngular.multifileplugin.testissuefaker.model.FakerSchemaDTO; | ||
|
||
public interface FakerApi { | ||
|
||
/** | ||
* POST /faker/generate-schemas | ||
* @param configurationDTO (required) | ||
* @return OK; (status code 200) Bad Request; (status code 400) Not found; (status code 404) | ||
*/ | ||
|
||
@Operation( | ||
operationId = "generateSchema", | ||
tags = {"SchemaGenerator"}, | ||
responses = { | ||
@ApiResponse(responseCode = "200", description = "OK", content = @Content(mediaType = "application/json", schema = @Schema(implementation = FakerSchemaDTO.class))), | ||
@ApiResponse(responseCode = "400", description = "Bad Request"), | ||
@ApiResponse(responseCode = "404", description = "Not found") | ||
} | ||
) | ||
@RequestMapping( | ||
method = RequestMethod.POST, | ||
value = "/faker/generate-schemas", | ||
produces = {"application/json"} | ||
) | ||
|
||
default ResponseEntity<FakerSchemaDTO> generateSchema(@Parameter(name = "configurationDTO", description = "", required = true, schema = @Schema(description = "")) @Valid @RequestBody ConfigurationDTO configurationDTO) { | ||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); | ||
} | ||
|
||
} |
Oops, something went wrong.