Skip to content

Commit

Permalink
fix(openchallenges): synchronize OC microservices with the API descri…
Browse files Browse the repository at this point in the history
…ption (#2354)

* sync-up-services

* do not fix indentation

* add missing updates

* rm OpenApiGeneratorApplicationTests.java

* Rename unit test file in challenge service

* Prevent the generation of the test file

---------

Co-authored-by: Thomas Schaffter <[email protected]>
  • Loading branch information
rrchai and tschaffter authored Nov 14, 2023
1 parent c26b2bb commit 6b7c5d2
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ README.md
**/application.properties
**/model/dto/*AllOf*.java
**/OpenApiGeneratorApplication.java
**/OpenApiGeneratorApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,3 @@ src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/Pag
src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/SimpleChallengeInputDataTypeDto.java
src/main/java/org/sagebionetworks/openchallenges/challenge/service/model/dto/SimpleChallengePlatformDto.java
src/main/resources/openapi.yaml
src/test/java/org/sagebionetworks/openchallenges/challenge/service/OpenApiGeneratorApplicationTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public ChallengeDto slug(String slug) {
*/
@NotNull
@Pattern(regexp = "^[a-z0-9]+(?:-[a-z0-9]+)*$")
@Size(min = 3, max = 60)
@Size(min = 3, max = 255)
@Schema(
name = "slug",
example = "awesome-challenge",
Expand All @@ -146,7 +146,7 @@ public ChallengeDto name(String name) {
* @return name
*/
@NotNull
@Size(min = 3, max = 60)
@Size(min = 3, max = 255)
@Schema(name = "name", description = "The name of the challenge.", required = true)
public String getName() {
return name;
Expand Down Expand Up @@ -191,7 +191,7 @@ public ChallengeDto description(String description) {
* @return description
*/
@NotNull
@Size(min = 0, max = 280)
@Size(min = 0, max = 1000)
@Schema(
name = "description",
example = "This is an example description of the challenge.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,13 @@ components:
ChallengeSlug:
description: The slug of the challenge.
example: awesome-challenge
maxLength: 60
maxLength: 255
minLength: 3
pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$"
type: string
ChallengeName:
description: The name of the challenge.
maxLength: 60
maxLength: 255
minLength: 3
type: string
ChallengeHeadline:
Expand All @@ -578,7 +578,7 @@ components:
ChallengeDescription:
description: The description of the challenge.
example: This is an example description of the challenge.
maxLength: 280
maxLength: 1000
minLength: 0
type: string
ChallengePlatformId:
Expand Down Expand Up @@ -721,13 +721,13 @@ components:
slug:
description: The slug of the challenge.
example: awesome-challenge
maxLength: 60
maxLength: 255
minLength: 3
pattern: "^[a-z0-9]+(?:-[a-z0-9]+)*$"
type: string
name:
description: The name of the challenge.
maxLength: 60
maxLength: 255
minLength: 3
type: string
headline:
Expand All @@ -739,7 +739,7 @@ components:
description:
description: The description of the challenge.
example: This is an example description of the challenge.
maxLength: 280
maxLength: 1000
minLength: 0
type: string
doi:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class OpenApiGeneratorApplicationTests {
class ChallengeServiceApplicationTests {

@Test
void contextLoads() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
@Schema(name = "BasicError", description = "Problem details (tools.ietf.org/html/rfc7807)")
@JsonTypeName("BasicError")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@lombok.AllArgsConstructor
@lombok.Builder
public class BasicErrorDto {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,7 @@ components:
- title
type: object
x-java-class-annotations:
- '@lombok.AllArgsConstructor'
- '@lombok.Builder'
OrganizationsPage_allOf:
properties:
Expand Down

0 comments on commit 6b7c5d2

Please sign in to comment.