-
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.
Showing
13 changed files
with
272 additions
and
23 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
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
67 changes: 67 additions & 0 deletions
67
multiapi-engine/src/test/resources/openapigenerator/testCreateBasicDTO/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,67 @@ | ||
--- | ||
openapi: "3.0.0" | ||
info: | ||
contact: | ||
name: Os3 Team | ||
email: os3-info@sngular.com | ||
version: 1.0.0 | ||
title: Testing example file | ||
license: | ||
name: MIT | ||
description: Testing example file | ||
servers: | ||
- url: http://localhost:8080/v1 | ||
tags: | ||
- name: testAdditionalProperties | ||
description: Test service | ||
paths: | ||
/test: | ||
summary: testCreateDTO | ||
get: | ||
summary: testCreateDTO | ||
description: Test File for SCC MultiApi Plugin. | ||
tags: | ||
- test | ||
operationId: testCreateDTO | ||
responses: | ||
'200': | ||
$ref: '#/components/responses/testCreate' | ||
components: | ||
responses: | ||
testCreate: | ||
description: An object with additional properties | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/test' | ||
schemas: | ||
test: | ||
type: object | ||
required: | ||
- id | ||
- age | ||
- properties | ||
properties: | ||
id: | ||
$ref: "#/components/schemas/strProperty" | ||
age: | ||
type: number | ||
format: int32 | ||
properties: | ||
$ref: "#/components/schemas/strProperty" | ||
address: | ||
type: object | ||
required: | ||
- country | ||
- city | ||
properties: | ||
street: | ||
$ref: "#/components/schemas/strProperty" | ||
country: | ||
$ref: "#/components/schemas/booleanProperty" | ||
city: | ||
$ref: "#/components/schemas/strProperty" | ||
strProperty: | ||
type: string | ||
booleanProperty: | ||
type: boolean |
46 changes: 46 additions & 0 deletions
46
multiapi-engine/src/test/resources/openapigenerator/testCreateBasicDTO/assets/TestApi.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,46 @@ | ||
package com.sngular.multifileplugin.testCreateBasicDTO; | ||
|
||
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.testCreateBasicDTO.model.TestDTO; | ||
|
||
public interface TestApi { | ||
|
||
/** | ||
* GET /test: testCreateDTO | ||
* @return An object with additional properties; (status code 200) | ||
*/ | ||
|
||
@Operation( | ||
operationId = "testCreateDTO", | ||
summary = "testCreateDTO", | ||
tags = {"test"}, | ||
responses = { | ||
@ApiResponse(responseCode = "200", description = "An object with additional properties", content = @Content(mediaType = "application/json", schema = @Schema(implementation = TestDTO.class))) | ||
} | ||
) | ||
@RequestMapping( | ||
method = RequestMethod.GET, | ||
value = "/test", | ||
produces = {"application/json"} | ||
) | ||
|
||
default ResponseEntity<TestDTO> testCreateDTO() { | ||
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...ngine/src/test/resources/openapigenerator/testCreateBasicDTO/assets/model/AddressDTO.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,33 @@ | ||
package com.sngular.multifileplugin.testCreateBasicDTO.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NonNull; | ||
import lombok.extern.jackson.Jacksonized; | ||
|
||
@Data | ||
public class AddressDTO { | ||
|
||
@JsonProperty(value ="country") | ||
@NonNull | ||
private Boolean country; | ||
|
||
@JsonProperty(value ="city") | ||
@NonNull | ||
private String city; | ||
|
||
@JsonProperty(value ="street") | ||
private String street; | ||
|
||
|
||
@Builder | ||
@Jacksonized | ||
private AddressDTO(@NonNull Boolean country, @NonNull String city, String street) { | ||
this.country = country; | ||
this.city = city; | ||
this.street = street; | ||
|
||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...i-engine/src/test/resources/openapigenerator/testCreateBasicDTO/assets/model/TestDTO.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,39 @@ | ||
package com.sngular.multifileplugin.testCreateBasicDTO.model; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import java.math.BigDecimal; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NonNull; | ||
import lombok.extern.jackson.Jacksonized; | ||
|
||
@Data | ||
public class TestDTO { | ||
|
||
@JsonProperty(value ="properties") | ||
@NonNull | ||
private String properties; | ||
|
||
@JsonProperty(value ="id") | ||
@NonNull | ||
private String id; | ||
|
||
@JsonProperty(value ="address") | ||
private AddressDTO address; | ||
|
||
@JsonProperty(value ="age") | ||
@NonNull | ||
private BigDecimal age; | ||
|
||
|
||
@Builder | ||
@Jacksonized | ||
private TestDTO(@NonNull String properties, @NonNull String id, AddressDTO address, @NonNull BigDecimal age) { | ||
this.properties = properties; | ||
this.id = id; | ||
this.address = address; | ||
this.age = age; | ||
|
||
} | ||
|
||
} |
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.