Need a way to get schema from adapted resources for intellisense
Summary of the new feature / enhancement
As part of the Bicep extension work, we need JSONSchema for any type of resource so that we can provide intellisense during authoring experience. Currently dsc simply expects the adapter to validate the input or reject as an error. We need to formalize this so that adapted resources can participate in intellisense.
Proposed technical implementation details (optional)
Initial thinking is that adapters support the schema operation, but have an additional argument for the adapted type and expected to return JSONSchema.
@andyleejordan as you are working on the Bicep extension, how would it work best for your extension?
I think the "top" command in the image below is what I think I would have expected to work.
dsc resource schema --adapter Microsoft.DSC/PowerShell --resource Microsoft.Windows.Settings/WindowsSettings
Ideally, you shouldn't have to specify --adapter in that example - as with invoking the resources, DSC knows which adapter the resource depends on and should route it automatically.
I think this issue essentially covers my ask to have a --all flag for dsc resource list but frankly, like Mikey says, DSC knows which adapters to use for these resources so dsc resource list -o json probably should just list all resources, adapted or not.
Now that we are planning to have an adapted.resource.json file that would contain the schema for build time generated adapted resources. For the runtime discovered adapted resources we should have the adapter create a JSON schema on behalf of the resource. At bare minimum it could just set the properties and types but ideally it would also take the [Validate] attributes and convert them into the appropriate JSON schema.