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

api: Prefer built-in type "url" over "string" for URL fields #951

Merged
merged 2 commits into from
Dec 10, 2024

Conversation

mbarnes
Copy link
Collaborator

@mbarnes mbarnes commented Dec 9, 2024

What this PR does

While working on #950 I realized TypeSpec has a built-in type for URL strings, which seemed appropriate to use for certain string fields in the API.

This does not change the generated Go code at all. All it does is add a "format: uri" qualifier to these string fields in openapi.json, which I don't even know if ARM cares about but why not.

Jira: None, just tweaking.
Link to demo recording:

Special notes for your reviewer

  • You can disregard the 1st commit. That's just updating generated code with the latest autorest version. There's several API-related pull requests with this commit now (#936, #950, and this) because I don't know which one will merge first.

Matthew Barnes added 2 commits December 9, 2024 13:27
No API changes, just re-running "make generate".

You may notice some of the indentation and other stylistic changes
in the generated code are non-sensical but that's just the tool.
This is just an API clarification. It does not change the generated
Golang code, but merely adds a "format: uri" attribute to the string
fields in openapi.json.
Copy link
Collaborator

@mociarain mociarain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mbarnes mbarnes merged commit 9ca2b57 into main Dec 10, 2024
18 checks passed
@mbarnes mbarnes deleted the api-url-type branch December 10, 2024 15:37
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.

3 participants