Skip to content

Commit d32785e

Browse files
committed
Adding more tests for v3.1
1 parent b1d4377 commit d32785e

File tree

906 files changed

+52829
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

906 files changed

+52829
-0
lines changed

pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
<spring-security-oauth2-authorization-server.version>1.4.0</spring-security-oauth2-authorization-server.version>
7070
<kotlin.version>2.1.0</kotlin.version>
7171
<kotlin.compiler.languageVersion>1.9</kotlin.compiler.languageVersion>
72+
<kotlin.compiler.apiVersion>1.9</kotlin.compiler.apiVersion>
7273
</properties>
7374

7475
<dependencyManagement>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
* * * * * Copyright 2019-2024 the original author or authors.
7+
* * * * *
8+
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
9+
* * * * * you may not use this file except in compliance with the License.
10+
* * * * * You may obtain a copy of the License at
11+
* * * * *
12+
* * * * * https://www.apache.org/licenses/LICENSE-2.0
13+
* * * * *
14+
* * * * * Unless required by applicable law or agreed to in writing, software
15+
* * * * * distributed under the License is distributed on an "AS IS" BASIS,
16+
* * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* * * * * See the License for the specific language governing permissions and
18+
* * * * * limitations under the License.
19+
* * * *
20+
* * *
21+
* *
22+
*
23+
*/
24+
25+
package test.org.springdoc.api.v31.app100;
26+
27+
import io.swagger.v3.oas.annotations.tags.Tag;
28+
import io.swagger.v3.oas.annotations.tags.Tags;
29+
import jakarta.validation.constraints.NotNull;
30+
31+
import org.springframework.web.bind.annotation.GetMapping;
32+
import org.springframework.web.bind.annotation.RestController;
33+
34+
@RestController
35+
@Tags(value = @Tag(name = "hello-ap1"))
36+
public class HelloController {
37+
38+
@GetMapping(value = "/search", produces = { "application/xml", "application/json" })
39+
@Tags(value = @Tag(name = "hello-ap2"))
40+
public PersonDTO getAllPets(@NotNull String toto) {
41+
return null;
42+
}
43+
44+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
* * * * * Copyright 2019-2024 the original author or authors.
7+
* * * * *
8+
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
9+
* * * * * you may not use this file except in compliance with the License.
10+
* * * * * You may obtain a copy of the License at
11+
* * * * *
12+
* * * * * https://www.apache.org/licenses/LICENSE-2.0
13+
* * * * *
14+
* * * * * Unless required by applicable law or agreed to in writing, software
15+
* * * * * distributed under the License is distributed on an "AS IS" BASIS,
16+
* * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* * * * * See the License for the specific language governing permissions and
18+
* * * * * limitations under the License.
19+
* * * *
20+
* * *
21+
* *
22+
*
23+
*/
24+
25+
package test.org.springdoc.api.v31.app100;
26+
27+
import io.swagger.v3.oas.annotations.media.Schema;
28+
29+
@Schema
30+
public class PersonDTO {
31+
private String email;
32+
33+
private String firstName;
34+
35+
private String lastName;
36+
37+
public PersonDTO() {
38+
}
39+
40+
public PersonDTO(final String email, final String firstName, final String lastName) {
41+
this.email = email;
42+
this.firstName = firstName;
43+
this.lastName = lastName;
44+
}
45+
46+
public String getEmail() {
47+
return email;
48+
}
49+
50+
public void setEmail(final String email) {
51+
this.email = email;
52+
}
53+
54+
public String getFirstName() {
55+
return firstName;
56+
}
57+
58+
public void setFirstName(final String firstName) {
59+
this.firstName = firstName;
60+
}
61+
62+
public String getLastName() {
63+
return lastName;
64+
}
65+
66+
public void setLastName(final String lastName) {
67+
this.lastName = lastName;
68+
}
69+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
* * * * * Copyright 2019-2024 the original author or authors.
7+
* * * * *
8+
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
9+
* * * * * you may not use this file except in compliance with the License.
10+
* * * * * You may obtain a copy of the License at
11+
* * * * *
12+
* * * * * https://www.apache.org/licenses/LICENSE-2.0
13+
* * * * *
14+
* * * * * Unless required by applicable law or agreed to in writing, software
15+
* * * * * distributed under the License is distributed on an "AS IS" BASIS,
16+
* * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* * * * * See the License for the specific language governing permissions and
18+
* * * * * limitations under the License.
19+
* * * *
20+
* * *
21+
* *
22+
*
23+
*/
24+
25+
package test.org.springdoc.api.v31.app100;
26+
27+
28+
import test.org.springdoc.api.v31.AbstractSpringDocV31Test;
29+
30+
import org.springframework.boot.autoconfigure.SpringBootApplication;
31+
32+
public class SpringDocApp100Test extends AbstractSpringDocV31Test {
33+
34+
@SpringBootApplication
35+
static class SpringDocTestApp {}
36+
37+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
* * * * * Copyright 2019-2024 the original author or authors.
7+
* * * * *
8+
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
9+
* * * * * you may not use this file except in compliance with the License.
10+
* * * * * You may obtain a copy of the License at
11+
* * * * *
12+
* * * * * https://www.apache.org/licenses/LICENSE-2.0
13+
* * * * *
14+
* * * * * Unless required by applicable law or agreed to in writing, software
15+
* * * * * distributed under the License is distributed on an "AS IS" BASIS,
16+
* * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* * * * * See the License for the specific language governing permissions and
18+
* * * * * limitations under the License.
19+
* * * *
20+
* * *
21+
* *
22+
*
23+
*/
24+
25+
package test.org.springdoc.api.v31.app101;
26+
27+
import io.swagger.v3.oas.annotations.media.Content;
28+
import io.swagger.v3.oas.annotations.media.Schema;
29+
import io.swagger.v3.oas.annotations.responses.ApiResponse;
30+
31+
import org.springframework.web.bind.annotation.GetMapping;
32+
import org.springframework.web.bind.annotation.RequestMapping;
33+
import org.springframework.web.bind.annotation.RestController;
34+
35+
@RestController
36+
@RequestMapping("/hello")
37+
public class HelloController {
38+
39+
@GetMapping
40+
@ApiResponse(content = @Content(schema = @Schema(
41+
description = "${test.app101.operation.hello.response.schema.description}",
42+
implementation = HelloDTO.class)))
43+
public HelloDTO hello() {
44+
return new HelloDTO();
45+
}
46+
47+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/*
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
* * * * * Copyright 2019-2024 the original author or authors.
7+
* * * * *
8+
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
9+
* * * * * you may not use this file except in compliance with the License.
10+
* * * * * You may obtain a copy of the License at
11+
* * * * *
12+
* * * * * https://www.apache.org/licenses/LICENSE-2.0
13+
* * * * *
14+
* * * * * Unless required by applicable law or agreed to in writing, software
15+
* * * * * distributed under the License is distributed on an "AS IS" BASIS,
16+
* * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* * * * * See the License for the specific language governing permissions and
18+
* * * * * limitations under the License.
19+
* * * *
20+
* * *
21+
* *
22+
*
23+
*/
24+
25+
package test.org.springdoc.api.v31.app101;
26+
27+
import com.fasterxml.jackson.annotation.JsonProperty;
28+
import io.swagger.v3.oas.annotations.media.Schema;
29+
30+
@Schema(description = "${test.app101.schema.hello.description}")
31+
public class HelloDTO {
32+
33+
@Schema(description = "${test.app101.schema.hello.param.id.description}")
34+
private String id;
35+
36+
@JsonProperty("id")
37+
public String getId() {
38+
return id;
39+
}
40+
41+
public void setId(String id) {
42+
this.id = id;
43+
}
44+
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
* * * * * Copyright 2019-2024 the original author or authors.
7+
* * * * *
8+
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
9+
* * * * * you may not use this file except in compliance with the License.
10+
* * * * * You may obtain a copy of the License at
11+
* * * * *
12+
* * * * * https://www.apache.org/licenses/LICENSE-2.0
13+
* * * * *
14+
* * * * * Unless required by applicable law or agreed to in writing, software
15+
* * * * * distributed under the License is distributed on an "AS IS" BASIS,
16+
* * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* * * * * See the License for the specific language governing permissions and
18+
* * * * * limitations under the License.
19+
* * * *
20+
* * *
21+
* *
22+
*
23+
*/
24+
25+
package test.org.springdoc.api.v31.app101;
26+
27+
28+
import test.org.springdoc.api.v31.AbstractSpringDocV31Test;
29+
30+
import org.springframework.boot.autoconfigure.SpringBootApplication;
31+
import org.springframework.test.context.ActiveProfiles;
32+
33+
@ActiveProfiles("101")
34+
public class SpringDocApp101Test extends AbstractSpringDocV31Test {
35+
36+
@SpringBootApplication
37+
static class SpringDocTestApp {}
38+
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/*
2+
*
3+
* *
4+
* * *
5+
* * * *
6+
* * * * * Copyright 2019-2024 the original author or authors.
7+
* * * * *
8+
* * * * * Licensed under the Apache License, Version 2.0 (the "License");
9+
* * * * * you may not use this file except in compliance with the License.
10+
* * * * * You may obtain a copy of the License at
11+
* * * * *
12+
* * * * * https://www.apache.org/licenses/LICENSE-2.0
13+
* * * * *
14+
* * * * * Unless required by applicable law or agreed to in writing, software
15+
* * * * * distributed under the License is distributed on an "AS IS" BASIS,
16+
* * * * * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17+
* * * * * See the License for the specific language governing permissions and
18+
* * * * * limitations under the License.
19+
* * * *
20+
* * *
21+
* *
22+
*
23+
*/
24+
25+
package test.org.springdoc.api.v31.app102;
26+
27+
import io.swagger.v3.oas.annotations.Parameter;
28+
import jakarta.validation.constraints.NotBlank;
29+
30+
public class InheritedRequestParams extends RequestParams {
31+
@Parameter(description = "parameter from child of RequestParams")
32+
@NotBlank
33+
private String childParam;
34+
35+
public String getChildParam() {
36+
return childParam;
37+
}
38+
39+
public void setChildParam(String childParam) {
40+
this.childParam = childParam;
41+
}
42+
}

0 commit comments

Comments
 (0)