forked from springdoc/springdoc-openapi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request springdoc#1718 from shardt68/javadoc-_of_JsonUnwra…
…pped_fields_not_set fixes springdoc#1717 javadoc of JsonUnwrapped fields not set
- Loading branch information
Showing
6 changed files
with
210 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
29 changes: 29 additions & 0 deletions
29
springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app165/Bar.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,29 @@ | ||
/* | ||
* | ||
* * 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.app165; | ||
|
||
/** | ||
* The type Bar. | ||
*/ | ||
public class Bar { | ||
/** | ||
* The BarField. | ||
*/ | ||
public String barField = "bar"; | ||
} |
32 changes: 32 additions & 0 deletions
32
springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app165/Foo.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,32 @@ | ||
/* | ||
* | ||
* * 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.app165; | ||
|
||
import com.fasterxml.jackson.annotation.JsonUnwrapped; | ||
|
||
/** | ||
* The type Foo. | ||
*/ | ||
public class Foo { | ||
/** | ||
* The Bar. | ||
*/ | ||
@JsonUnwrapped | ||
public Bar bar; | ||
} |
42 changes: 42 additions & 0 deletions
42
springdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app165/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,42 @@ | ||
/* | ||
* | ||
* * 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.app165; | ||
|
||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import io.swagger.v3.oas.annotations.parameters.RequestBody; | ||
|
||
/** | ||
* The type Hello controller. | ||
*/ | ||
@RestController("/api") | ||
public class HelloController { | ||
|
||
/** | ||
* Process foo. | ||
* | ||
* @param a the a | ||
* @return the foo | ||
*/ | ||
@PostMapping | ||
public Foo process(@RequestBody Foo a) { | ||
return a; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...gdoc-openapi-javadoc/src/test/java/test/org/springdoc/api/app165/SpringDocApp165Test.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,36 @@ | ||
/* | ||
* | ||
* * 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.app165; | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
import test.org.springdoc.api.AbstractSpringDocTest; | ||
|
||
/** | ||
* The type Spring doc app 165 test. | ||
*/ | ||
public class SpringDocApp165Test extends AbstractSpringDocTest { | ||
|
||
/** | ||
* The type Spring doc test app. | ||
*/ | ||
@SpringBootApplication | ||
static class SpringDocTestApp { | ||
} | ||
} |
67 changes: 67 additions & 0 deletions
67
springdoc-openapi-javadoc/src/test/resources/results/app165.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,67 @@ | ||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"title": "OpenAPI definition", | ||
"version": "v0" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost", | ||
"description": "Generated server url" | ||
} | ||
], | ||
"tags": [ | ||
{ | ||
"name": "hello-controller", | ||
"description": "The type Hello controller." | ||
} | ||
], | ||
"paths": { | ||
"/": { | ||
"post": { | ||
"tags": [ | ||
"hello-controller" | ||
], | ||
"summary": "Process foo.", | ||
"description": "Process foo.", | ||
"operationId": "process", | ||
"requestBody": { | ||
"description": "the a", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Foo" | ||
} | ||
} | ||
} | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "the foo", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"$ref": "#/components/schemas/Foo" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"Foo": { | ||
"type": "object", | ||
"properties": { | ||
"barField": { | ||
"type": "string", | ||
"description": "The BarField." | ||
} | ||
}, | ||
"description": "The type Foo." | ||
} | ||
} | ||
} | ||
} |