-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Support passing OpenAPI spec version and document name via dotnet-getdocument #55823
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
Conversation
I'm assuming this is an enum member, but it seems a little clunky - I feel like I'd expect to pass "2.0" or something. But maybe we don't expect the tool to have any human users? |
Yep, this maps directly to the OpenApiSpecVersion enum supported by the OpenAPI package (ref). We could prettify the value expected here but I liked being able to pass it directly to I don't anticipate that users will interact with these parameters and if they do it would be through MSBuild properties/Visual Studio config. |
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 have some concerns about validation but seems generally good.
src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandContext.cs
Outdated
Show resolved
Hide resolved
src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs
Outdated
Show resolved
Hide resolved
src/Tools/GetDocumentInsider/src/Commands/GetDocumentCommandWorker.cs
Outdated
Show resolved
Hide resolved
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.
Some nits about resource strings, but LGTM. Thanks for the changes!
The
getdocument
API for resolving documents at build-time only supports serializing documents to the spec version serialized via OpenAPI options. We want to add support for overriding this option for integration scenarios where 3rd-party tools might support only certain versions of the OpenAPI specification.This PR:
--openapi-version
flag to thegetdocument
CLI application to support setting the OpenAPI spec version to use when generating documents--document-name
flag to thegetdocument
CLI application to support generating the OpenAPI file for a given documentGenerateAsync
method to theIDocumentProvider
interface to support passing the OpenAPI spec version during serializationGetDocument
toolSample invocation: