Skip to content
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

feat: adds a name field to the server object #4469

Open
wants to merge 5 commits into
base: v3.2-dev
Choose a base branch
from

Conversation

baywet
Copy link
Contributor

@baywet baywet commented Mar 19, 2025

fixes #1821

Tick one of the following options:

  • schema changes are included in this pull request
  • schema changes are needed for this pull request but not done yet
  • no schema changes are needed for this pull request

@ralfhandl ralfhandl linked an issue Mar 19, 2025 that may be closed by this pull request
@ralfhandl
Copy link
Contributor

Could you please add a name to the first Server Object in the test case https://github.com/OAI/OpenAPI-Specification/blob/v3.2-dev/tests/schema/pass/servers.yaml?

(Adding it to the first one should avoid merge conflicts with #4456)

@baywet
Copy link
Contributor Author

baywet commented Mar 19, 2025

Thanks for the quick review! I have made the requested updates.

@handrews
Copy link
Member

@baywet this makes name and description both unrestricted strings. Are there supposed to be limitations on what consistitutes a valid name? The issue mentions using these for code generation.

@ralfhandl ralfhandl requested a review from a team March 19, 2025 16:34
@baywet
Copy link
Contributor Author

baywet commented Mar 19, 2025

@handrews I was wondering that myself as I put the pull request together. So I went and looked for precedent work, like the parameter name, the license name, schema properties name, etc...
Although there are implicit limitations (parameters must abide by HTTP query parameters conventions if they are query parameters, path parameter conventions if they are path parameters, json schema properties must be a valid JSON property name, etc...), we don't call any of that explicitly out?

As for code generation, the tool can always run some kind of sanitation routine based on their own domain restrictions.

This is why I decided to leave it open, but happy to narrow it down based on this audience's feedback.

@handrews
Copy link
Member

@baywet thanks for the research and summary. If the TSC is fine with continuing in the same vein as existing name fields, I have no objection. We have had some complaints in this area (which I'm too lazy to dig up right now), but choosing the right restrictions is not an obvious thing. On the other hand, we should be a lot more clear in Moonwalk, particularly with full Unicode support being something people now expect.

@lornajane
Copy link
Contributor

I have no objections to either using the field name name, or to leaving the validation pretty open in common with the other fields. If I understood this correctly, the name is for tools outside of OpenAPI to use, we're not suggesting people can use this name to refer to a server entry from anywhere else within the OpenAPI file?

@baywet
Copy link
Contributor Author

baywet commented Mar 24, 2025

@lornajane correct, name is just informative as far as I understood the initial issue, no reference mechanism from the spec. It may be used in code generation or to produce other generated artifacts (docs, etc...) at which point we should probably leave that up to the tool consuming it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add 'name' field to servers
4 participants