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
bnasslahsen
committed
Jun 29, 2020
1 parent
5e05311
commit 7c24981
Showing
8 changed files
with
227 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
group = org.springdoc | ||
version = 1.4.3-SNAPSHOT | ||
org.gradle.daemon = true | ||
org.gradle.caching=true | ||
org.gradle.parallel=true |
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
35 changes: 35 additions & 0 deletions
35
...doc-openapi-webmvc-core/src/test/java/test/org/springdoc/api/app125/DeprecatedEntity.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,35 @@ | ||
package test.org.springdoc.api.app125; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
|
||
/** | ||
* @author bnasslahsen | ||
*/ | ||
public class DeprecatedEntity | ||
{ | ||
@Schema(deprecated = false) | ||
private String myNonDeprecatedField; | ||
|
||
@Schema(deprecated = true) | ||
private String mydeprecatedField; | ||
|
||
public String getMyNonDeprecatedField() | ||
{ | ||
return myNonDeprecatedField; | ||
} | ||
|
||
@Deprecated | ||
public DeprecatedEntity setMyNonDeprecatedField(String myNonDeprecatedField) | ||
{ | ||
this.myNonDeprecatedField = myNonDeprecatedField; | ||
return this; | ||
} | ||
|
||
public String getMydeprecatedField() { | ||
return mydeprecatedField; | ||
} | ||
|
||
public void setMydeprecatedField(String mydeprecatedField) { | ||
this.mydeprecatedField = mydeprecatedField; | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...gdoc-openapi-webmvc-core/src/test/java/test/org/springdoc/api/app125/HelloController.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,19 @@ | ||
package test.org.springdoc.api.app125; | ||
|
||
import javax.validation.constraints.NotNull; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
/** | ||
* @author bnasslahsen | ||
*/ | ||
@RestController | ||
public class HelloController { | ||
|
||
@GetMapping(value = "/search", produces = { "application/xml", "application/json" }) | ||
public DeprecatedEntity getAllPets(@NotNull String toto) { | ||
return null; | ||
} | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
...-openapi-webmvc-core/src/test/java/test/org/springdoc/api/app125/SpringDocApp125Test.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 @@ | ||
/* | ||
* | ||
* * | ||
* * * | ||
* * * * Copyright 2019-2020 the original author or authors. | ||
* * * * | ||
* * * * 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 | ||
* * * * | ||
* * * * https://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. | ||
* * * | ||
* * | ||
* | ||
* | ||
*/ | ||
package test.org.springdoc.api.app125; | ||
|
||
import test.org.springdoc.api.AbstractSpringDocTest; | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.test.context.TestPropertySource; | ||
|
||
|
||
/** | ||
* Tests Spring meta-annotations as method parameters | ||
*/ | ||
@TestPropertySource(properties = "springdoc.model-converters.deprecating-converter.enabled=false") | ||
public class SpringDocApp125Test extends AbstractSpringDocTest { | ||
|
||
@SpringBootApplication | ||
static class SpringDocTestApp {} | ||
} |
66 changes: 66 additions & 0 deletions
66
springdoc-openapi-webmvc-core/src/test/resources/results/app125.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,66 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "OpenAPI definition", | ||
"version": "v0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost", | ||
"description": "Generated server url" | ||
} | ||
], | ||
"paths": { | ||
"/search": { | ||
"get": { | ||
"tags": [ | ||
"hello-controller" | ||
], | ||
"operationId": "getAllPets", | ||
"parameters": [ | ||
{ | ||
"name": "toto", | ||
"in": "query", | ||
"required": true, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"application/xml": { | ||
"schema": { | ||
"$ref": "#/components/schemas/DeprecatedEntity" | ||
} | ||
}, | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/DeprecatedEntity" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"DeprecatedEntity": { | ||
"type": "object", | ||
"properties": { | ||
"myNonDeprecatedField": { | ||
"type": "string" | ||
}, | ||
"mydeprecatedField": { | ||
"type": "string", | ||
"deprecated": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |