-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Remove CodeGenerator
metadata in default service reference experience
#7491
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
Comments
@glennc I put this in Preview4. That make sense to you? @mkArtakMSFT the "Small" cost here doesn't mean calendar time due to the need for NSwag changes. |
From discussion today. Generator tag isn't required by default. There will be a language property a customer can add with the values "Default", and "TypeScript" where default means whatever the extensions/language the project is for and TypeScript is TypeScript. |
- set `%(FirstForGenerator)` based on `%(CodeGenerator)` metadata Side note, PR fixes include - add `%(FirstForGenerator)` metadata, #4916 - add support for disabling design-time builds, #4944 - change default output directory to `obj/`, #4945 1 of 2 (remainder will come with #8242) - provide a default `%(CodeGenerator)` value, ##7491 1 of 2 (remainder will come in next milestone)
- #7492 - remove document generation from client project; will be included in Web API project infrastructure (coming soon) - adjust eng/ProjectReferences.props to new project name - simplify item de-duplication in `_CreateCompileItemsForServiceFileReferences` target i.e. use `Remove` attribute - also handle `.tsx` files in this target - provide `%(FirstForGenerator)` metadata, #4916 - add `$(OpenApiGenerateAtDesignTime)` property (default `true` for now), #4944 - generate code in `obj` directory by default, #4945 - provide a default `%(CodeGenerator)` value, ##7491 1 of 2 (remainder will come in next milestone) nits: - remove a useless `StringBuilder.Append(...)` call - remove `%(OpenApiProjectReference.SourceProject)` metadata, duplicated `%(OriginalItemSpec)` - be more consistent about using element syntax for item metadata
Partially addressed in ce8f053. Will add language metadata soon. |
After offline discussion with @glennc, we've decided to close this issue and await custom input on the feature's overall usability |
Aim here is to remove the current requirement to specify the
CodeGenerator
metadata on<Service...Reference>
(soon<OpenApiReference>
and<ProtobufReference>
) items in a project file.Some metadata must remain to say "give me TypeScript" (instead of project's default language) but this should be the exception and not the rule. Fortunately, the type of document is going to be explicit (again
<OpenApiReference>
and<ProtobufReference>
) and we won't have to choose among multiple tools. Probably best to makeTargetLanguage
the main override we provide in this area. (@glennc agreed?)This change will require our Open API code generation partners (NSwag, AutoRest, ...) either all implement the same target name or include a well-known property specifying their target's prefix. Either way, the last file that declares a target or updates a property wins. So, unless our partners object, let's avoid the indirection and go with a single Open API target name. (gRPC doesn't have multiple partners for the foreseeable future and should be fine with a single target for that scenario.)
The text was updated successfully, but these errors were encountered: