-
-
Notifications
You must be signed in to change notification settings - Fork 513
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restentpoints with same name get mix up. Fixes #2876
- Loading branch information
1 parent
cce8e8b
commit 0775180
Showing
9 changed files
with
292 additions
and
15 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
48 changes: 48 additions & 0 deletions
48
...tarter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/DemoRestController.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,48 @@ | ||
package test.org.springdoc.api.v31.app240; | ||
|
||
import java.util.HashSet; | ||
import java.util.Optional; | ||
import java.util.Set; | ||
|
||
import io.swagger.v3.oas.annotations.Parameter; | ||
|
||
import org.springframework.http.MediaType; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PatchMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PostMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequestMapping("/demo") | ||
public class DemoRestController { | ||
|
||
@GetMapping(produces = MediaType.APPLICATION_JSON_VALUE) | ||
public Set<String> getDemo( | ||
@Parameter(required = false, description = "Very important description.") | ||
@RequestParam(name = "darstellung", required = false) final Optional<String> darstellung) { | ||
return new HashSet<>(); | ||
} | ||
|
||
@PostMapping(consumes = MediaType.APPLICATION_JSON_VALUE) | ||
public ResponseEntity<?> setDemo(@RequestBody final String str) { | ||
return ResponseEntity.noContent().build(); | ||
} | ||
|
||
@GetMapping(value = "/{vvpId}", produces = MediaType.APPLICATION_JSON_VALUE) | ||
public String getDemo(@PathVariable("vvpId") final Long vvpId) { | ||
return "Test"; | ||
} | ||
|
||
@PatchMapping("/{vvpId}") | ||
public ResponseEntity<?> patchDemo(@PathVariable("vvpId") final Long idVerfahren, | ||
@RequestBody() final String jsonPatch, | ||
final Optional<Boolean> statusKinderAendern) { | ||
return ResponseEntity.noContent().build(); | ||
} | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...api-starter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/OpenApiConfig.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 test.org.springdoc.api.v31.app240; | ||
|
||
import org.springdoc.core.customizers.OpenApiCustomizer; | ||
import org.springdoc.core.customizers.ServerBaseUrlCustomizer; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.http.HttpRequest; | ||
|
||
@Configuration | ||
public class OpenApiConfig { | ||
|
||
@Bean | ||
public OpenApiCustomizer openApiCustomiser() { | ||
return openApi -> { | ||
|
||
}; | ||
} | ||
|
||
@Bean | ||
ServerBaseUrlCustomizer serverBaseUrlCustomizer() { | ||
return new ServerBaseUrlCustomizer() { | ||
|
||
@Override | ||
public String customize(final String serverBaseUrl, | ||
final HttpRequest request) { | ||
// TODO Auto-generated method stub | ||
return null; | ||
} | ||
|
||
}; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
...arter-webmvc-api/src/test/java/test/org/springdoc/api/v31/app240/SpringDocApp240Test.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-2025 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.v31.app240; | ||
|
||
import test.org.springdoc.api.v31.AbstractSpringDocTest; | ||
|
||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.test.context.TestPropertySource; | ||
|
||
@TestPropertySource(properties = "springdoc.api-docs.resolve-schema-properties=true" ) | ||
public class SpringDocApp240Test extends AbstractSpringDocTest { | ||
|
||
@SpringBootApplication | ||
static class SpringDocTestApp {} | ||
} |
151 changes: 151 additions & 0 deletions
151
springdoc-openapi-starter-webmvc-api/src/test/resources/results/3.1.0/app240.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,151 @@ | ||
{ | ||
"openapi": "3.1.0", | ||
"info": { | ||
"title": "OpenAPI definition", | ||
"version": "v0" | ||
}, | ||
"paths": { | ||
"/demo": { | ||
"get": { | ||
"tags": [ | ||
"demo-rest-controller" | ||
], | ||
"operationId": "getDemo", | ||
"parameters": [ | ||
{ | ||
"name": "darstellung", | ||
"in": "query", | ||
"description": "Very important description.", | ||
"required": false, | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"uniqueItems": true | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"post": { | ||
"tags": [ | ||
"demo-rest-controller" | ||
], | ||
"operationId": "setDemo", | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": true | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"/demo/{vvpId}": { | ||
"get": { | ||
"tags": [ | ||
"demo-rest-controller" | ||
], | ||
"operationId": "getDemo_1", | ||
"parameters": [ | ||
{ | ||
"name": "vvpId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
} | ||
], | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"patch": { | ||
"tags": [ | ||
"demo-rest-controller" | ||
], | ||
"operationId": "patchDemo", | ||
"parameters": [ | ||
{ | ||
"name": "vvpId", | ||
"in": "path", | ||
"required": true, | ||
"schema": { | ||
"type": "integer", | ||
"format": "int64" | ||
} | ||
}, | ||
{ | ||
"name": "statusKinderAendern", | ||
"in": "query", | ||
"required": false, | ||
"schema": { | ||
"type": "boolean" | ||
} | ||
} | ||
], | ||
"requestBody": { | ||
"content": { | ||
"application/json": { | ||
"schema": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": true | ||
}, | ||
"responses": { | ||
"200": { | ||
"description": "OK", | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"type": "object" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"components": {} | ||
} |