-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MATGONZALEZ: define default None in non required params in Routes for… #693
Merged
gheine
merged 2 commits into
apicollective:main
from
Matuco17:MATGONZALEZ_PlayRoutesOptionalParams
Mar 22, 2024
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
lib/src/test/resources/generators/play-2-route-reference-api.routes
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Generated by API Builder - https://www.apibuilder.io | ||
# Service version: 0.3.47 | ||
|
||
GET /echoes controllers.Echoes.get(foo: _root_.scala.Option[String], optional_messages: _root_.scala.Option[List[String]], required_messages: List[String]) | ||
GET /echoes/arrays-only controllers.Echoes.getArraysOnly(optional_messages: _root_.scala.Option[List[String]], required_messages: List[String]) | ||
GET /echoes controllers.Echoes.get(foo: _root_.scala.Option[String] ?= None, optional_messages: _root_.scala.Option[List[String]] ?= None, required_messages: List[String]) | ||
GET /echoes/arrays-only controllers.Echoes.getArraysOnly(optional_messages: _root_.scala.Option[List[String]] ?= None, required_messages: List[String]) | ||
GET /groups/:organization controllers.Groups.getByOrganization(organization: _root_.java.util.UUID) | ||
POST /members controllers.Members.post() | ||
GET /members controllers.Members.get(guid: _root_.scala.Option[_root_.java.util.UUID], organization_guid: _root_.scala.Option[_root_.java.util.UUID], user_guid: _root_.scala.Option[_root_.java.util.UUID], role: _root_.scala.Option[String]) | ||
GET /members controllers.Members.get(guid: _root_.scala.Option[_root_.java.util.UUID] ?= None, organization_guid: _root_.scala.Option[_root_.java.util.UUID] ?= None, user_guid: _root_.scala.Option[_root_.java.util.UUID] ?= None, role: _root_.scala.Option[String] ?= None) | ||
GET /members/:organization controllers.Members.getByOrganization(organization: _root_.java.util.UUID) | ||
POST /members/:organization/members_bulk controllers.Members.postMembersBulkByOrganization(organization: _root_.java.util.UUID) | ||
POST /organizations controllers.Organizations.post() | ||
GET /organizations controllers.Organizations.get(guid: _root_.scala.Option[_root_.java.util.UUID], name: _root_.scala.Option[String]) | ||
GET /organizations controllers.Organizations.get(guid: _root_.scala.Option[_root_.java.util.UUID] ?= None, name: _root_.scala.Option[String] ?= None) | ||
GET /organizations/:guid controllers.Organizations.getByGuid(guid: _root_.java.util.UUID) | ||
POST /users controllers.Users.post() | ||
GET /users controllers.Users.get(guid: _root_.scala.Option[_root_.java.util.UUID], organization_guids: _root_.scala.Option[List[Long]], age_group: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup], email: _root_.scala.Option[String], active: Boolean ?= true) | ||
GET /users controllers.Users.get(guid: _root_.scala.Option[_root_.java.util.UUID] ?= None, organization_guids: _root_.scala.Option[List[Long]] ?= None, age_group: _root_.scala.Option[io.apibuilder.reference.api.v0.models.AgeGroup] ?= None, email: _root_.scala.Option[String] ?= None, active: Boolean ?= true) | ||
GET /users/:age_group controllers.Users.getByAgeGroup(age_group: io.apibuilder.reference.api.v0.models.AgeGroup) | ||
POST /users/noop controllers.Users.postNoop() |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure we want to provide a default for all Options here (unsure if/what this might break). How about we only provide the default for
ScalaDatatype.Option(ScalaDatatype.List(_))
andScalaDatatype.Option(ScalaDatatype.Map(_))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tested it with a Optional[Long] and there is no need to force the default to None, so as you say only keeping it to List and Map on the meantime,