Closed tschaffter closed 8 months ago
PR started in #2393.
🏀 passing it to you now, @rrchai !
The update for API description has been added to #2393
🏀 passing it to you now, @tschaffter ~
challenge.platform
for required
challenge propertiesWhen the platform property is required
:
@NotNull
@Valid
@Schema(name = "platform", required = true)
public SimpleChallengePlatformDto getPlatform() {
return platform;
}
When the platform property is not required:
@Valid
@Schema(name = "platform", required = false)
public SimpleChallengePlatformDto getPlatform() {
return platform;
}
In both case, the current property value returned is (could be changed in the mapper):
"platform": {
"id": null,
"slug": null,
"name": null
},
Adding nullable: true
to SimpleChallengePlatform
does not affect the DTO object.
challenge.platform
nullableTODO
A DTO object freshly created comes with falsy values.
challenge dto initial: class ChallengeDto {
id: null
slug: null
name: null
headline: null
description: null
doi: null
status: null
difficulty: null
platform: null
websiteUrl: null
avatarUrl: null
incentives: []
submissionTypes: []
inputDataTypes: null
startDate: null
endDate: null
starredCount: 0
createdAt: null
updatedAt: null
}
Consider removing the properties that should not be returned.
nullable
is replaced by null
type in OpenAPI 3.1Note we are still using OpenAPI 3.0.3
See https://www.openapis.org/blog/2021/02/16/migrating-from-openapi-3-0-to-3-1-0
Is there an existing issue for this?
What product(s) are you seeing the problem on?
OpenChallenges
Current behavior
The OC Data sheet registers a platform named "other". A first issue is that counting the platforms from the list of challenge platform returns currently 14 while we technically capture information only about 13 platforms. Other issues may arise as we plan to create a challenge platform search page.
Instead, we should no longer create a platform for "other" and set the property
challenge.platform
to null / undefined when no known challenge platform is used by the challenge. This approach implies changes at the following levels:openchallenges-api-description
) (@rrchai )The above tasks should be performed in this order, and this will be reflected on the person assigned to this ticket. Let's try to do everything in a single feature PR that Verena will create as the first contributor to keep thing simple.
Cc: @vpchung @rrchai
Expected behavior
No response
Anything else?
No response
Commit ID
No response
Are you developing inside the dev container?
Code of Conduct