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

Improve validation and completions with additionalProperties #3214

Open
majastrz opened this issue Jun 15, 2021 · 0 comments
Open

Improve validation and completions with additionalProperties #3214

majastrz opened this issue Jun 15, 2021 · 0 comments
Labels
enhancement New feature or request type system

Comments

@majastrz
Copy link
Member

Is your feature request related to a problem? Please describe.

  • We should offer property access completions for the "additional" properties that have actually been specified in the resource declaration.
  • Property access on an "additional" property that isn't specified in the resource declaration should produce a warning. (Can't be an error because RPs can violate the RPC and return a modified set of properties.)
resource bp 'Microsoft.Blueprint/blueprintAssignments@2018-11-01-preview' = {
  name: 't'
  location: resourceGroup().location
  identity: {
    type: 'None'
  }
  properties: {
    parameters: {
      'foo': {
        reference: {
          keyVault: {
            id: 's'
          }
          secretName: 's'
        }
      }
    }
    resourceGroups: {
      'bar': {
        name: 's'
        location: 's'
      }
    }
  }
}

// no name completions
var test = bp.properties.resourceGroups.|

// prop. access completions work at `|` but no warning on "blah"
var test2 = bp.properties.resourceGroups.blah.

This originally was discovered during #3084

@majastrz majastrz added the enhancement New feature or request label Jun 15, 2021
@ghost ghost added the Needs: Triage 🔍 label Jun 15, 2021
@majastrz majastrz changed the title Improve validation and completsions with additionalProperties Improve validation and completions with additionalProperties Jun 15, 2021
@alex-frankel alex-frankel added this to the Committed Backlog milestone Jun 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request type system
Projects
None yet
Development

No branches or pull requests

2 participants