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.
docs: API workspace agents and builds #5538
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
docs: API workspace agents and builds #5538
Changes from 19 commits
a3fbe72
fbe1d70
96daf47
663ec87
fc00d7e
67a85b9
ce8c7ea
d2a9af5
f37c6b3
596cdbd
eb4ba48
e314c24
97cd7ac
ae06598
a88968c
4519636
6bb31ce
fb2e7c3
d38b26c
20dcb3a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
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.
Perhaps I've asked before, but is there a way to automatically transform these based on the Go type? It seems unfortunate we'd have to tag every new struct, and we will almost certainly miss to add the tag to fields in the future.
It'd be nice if
format
was reserved as an override sinceuuid
andtime.Time
are essentially never a different format (would take a custom json Marshaller at which point usingformat
would be appropriate).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'm afraid that we would need a fork to apply this feature, let's say,
auto-format
. It doesn't look like something we can truly solve just with validation.I'm not sure why it hasn't been implemented this way. Even official examples suggest using
format
tags.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 can certainly understand why it's not the default (due to middlewares and handlers that can do whatever). But it'd be nice to enable such a feature.
Do you think they'd be open to it if we made a PR? Seems like many people could benefit.
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.
At the moment, we're using version
swaggo v1.8.6
, but I can try to bump it tov1.8.9
so that we will also benefit from future PRs. AFAIR v1.8.9 added a lot of noise around all possible values oftime.Duration
or strange value examples: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.
Ah, if
v1.8.9
is problematic we can punt it for now unless you think there's a benefit to upgrading?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.
Let me prepare a draft PR and we can discuss the upgrade there.
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.
#5590
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.
Nice work! Once we get the docs in shape, it'd be nice to try to process the Go code to find these enums automatically.
Btw, would it be possible to move this enum description to the type? Like:
Perhaps not supported by swaggo.
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.
There are some magic undocumented extensions like
x-enum-varnames
orx-enum-descriptions
, but I don't think that this is what we're looking for.See swaggo/swag#984
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.
Indeed, that seems useful with enums that are number based and have string representations in (de-)serialization.