-
Notifications
You must be signed in to change notification settings - Fork 754
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
Bicep types are not generated for resources that use "name" as a polymorphic discriminator #657
Comments
Some possible solutions:
resource myWebConfig 'Microsoft.Web/sites/config@2020-06-01' = {
parent: myWebsite // reference to parent resource
name: 'authsettings' // this is now a constant type and can be used as a discriminator key
}
|
btw as this is very much related to app services APIs is there any plan to have better intellisense for that API. Overall that API is tone of the worse as it is one thing build on top of another and they continue to do that (new logic app). For example depending on the kind value which is string and there you can have one value or multiple values separated by comma the properties for Microsoft.Web/sites resource will be different. Meaning that there could be some properties that are relevant for web apps only and some others only for container web apps and third for container web apps with linux, etc. |
These are a pain for tooling... IDK if I completely follow your proposal but I think it has legs. Basically, for a singleton we'd have to give some indication, somewhere that's that what is it. Ideally, we could to this in the tooling/metadata rather than have the user specify. IOW, we know that web's "config" resource has additional information to specify it's "shape" - as @slavizh mentions this is usually "kind" or "sku" but the web api's predate those properties. We could emulate that behavior in these singleton's - either by the user specifying or by tooling keying off of the name somehow. Not sure we need to solve this in V1 but good to keep in mind as we look at things like #127 |
At minimum, we should treat this as "any" type so that it does not throw an error/warning |
any update/ETA on this? |
No work has started. I think plan is to revisit this once #127 is done or as part of implementation of that feature. If using the new child resource syntax, we should be able to properly validate these resources |
I noticed, that this might be also a problem in type generation itself, see Azure/bicep-types-az#101 |
You're correct - there's also some work we need to do type generation for this issue. |
First reported under #656.
Some RPs define multiple resources of the same resourceType, with a fixed set of (or enum-valued) name values, with a different body shape depending on the value of name. This is problematic for child resources, because Bicep expects the fully-qualified name of the type.
The text was updated successfully, but these errors were encountered: