Skip to content
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

(MAINT) Improve schemas #172

Merged

Conversation

michaeltlombardi
Copy link
Collaborator

PR Summary

This change makes minor fixes and improvements to the decomposed schemas.

Changes include:

  1. Fixing the data-type conditionals for configuration parameters so that the min*/max* keywords only apply to the correct data types.

  2. Adding type validation for default and allowed values based on the defined data type for the parameter.

  3. Adding VS Code keywords to improve the DevX when authoring configurations and resource manifests:

    • The markdownDescription ensures that descriptive text can render as Markdown. Where possible, these descriptions also include a link to the relevant online documentation to help authors get more information as needed.
    • The markdownEnumDescriptions keyword enables adding per-enum-value documentation that shows on hover and with auto-complete.
    • The patternErrorMessage shows a useful error message instead of just informing the user that a string did not match a regular expression.
    • The defaultSnippets enables simpler auto-complete for values, allowing an author to pick from a list of snippets that work like normal VS Code snippets.
  4. Ensuring that the processed schemas only include the VS Code keywords for the bundled VS Code schemas.

  5. Adding schema associations so *.dsc.resource.json files are associated with the bundled VS Code schema for resource manifests and .dsc[.config].yaml files are associated with the bundled VS Code schema for configuration documents.

PR Context

Together, these changes make the schemas more accurate and improve the authoring DevX for DSCv3.

This change makes minor fixes and improvements to the decomposed schemas.

Changes include:

1. Fixing the data-type conditionals for configuration parameters so that
   the `min*`/`max*` keywords only apply to the correct data types.
1. Adding type validation for default and allowed values based on the defined
   data type for the parameter.
1. Adding VS Code keywords to improve the DevX when authoring configurations
   and resource manifests:

   - The `markdownDescription` ensures that descriptive text can render as
     Markdown. Where possible, these descriptions also include a link to
     the relevant online documentation to help authors get more information
     as needed.
   - The `markdownEnumDescriptions` keyword enables adding per-enum-value
     documentation that shows on hover and with auto-complete.
   - The `patternErrorMessage` shows a useful error message instead of just
     informing the user that a string did not match a regular expression.
   - The `defaultSnippets` enables simpler auto-complete for values, allowing
     an author to pick from a list of snippets that work like normal VS Code
     snippets.
1. Ensuring that the processed schemas only include the VS Code keywords for
   the bundled VS Code schemas.
1. Adding schema associations so `*.dsc.resource.json` files are associated with
   the bundled VS Code schema for resource manifests and `.dsc[.config].yaml`
   files are associated with the bundled VS Code schema for configuration
   documents.

Together, these changes make the schemas more accurate and improve the authoring
DevX for DSCv3.
auto-merge was automatically disabled August 31, 2023 13:57

Head branch was pushed to by a user without write access

@SteveL-MSFT SteveL-MSFT merged commit fb3ef20 into PowerShell:main Sep 1, 2023
4 checks passed
@michaeltlombardi michaeltlombardi deleted the maint/main/enhance-schemas branch September 1, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants