Skip to content

Change v2 schema for parameter. #622

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

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 43 additions & 20 deletions specs/PowershellCmdletV2.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"cmdletParameters": { // naming pending? use only a single word as the name if possible
"items": {
"additionalProperties": false,
"required": ["name", "description", "type", "position", "parameterValueGroup"],
"required": ["name", "description", "type", "parameterSet"],
"properties": {
"name": {
"type": "string"
Expand All @@ -146,42 +146,65 @@
"contentType": "markdown",
"tags": ["localizable"]
},
"isRequired": {
"type": "boolean"
"type": {
"type": "string",
"contentType": "markdown"
},
"parameterSet" : {
"items": {
"type": "array",
"minItems": 1,
"additionalProperties": false,
"required": [ "name" ],
"properties": {
"name": {
"type": "string"
},
"position": {
"type": "string"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this now be an int?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it can, but i've not gone through the current examples to see if it's "named" anywhere

Copy link
Collaborator

@sdwheeler sdwheeler Feb 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. PowerShell shows named parameters as [int]::MinValue. But we show it as Named in the markdown yaml block. So it is a data vs. rendering question.

},
"valueByPipeline": {
"type": "boolean"
},
"valueByPipelineByPropertyName": {
"type": "boolean"
},
"valueFromRemainingArguments": {
"type": "boolean"
},
"isRequired": { // mandatory
"type": "boolean"
}
}
}
},
"applicable": {
"applicable": { // ????
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an Office only thing.. @theJasonHelmick was going to reach out and verify if this is still something they still need.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applicable attribute might need to be moved into parameterset.parameter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wasn't sure what it means (thus the ???) - there doesn't seem to be an actual parameter attribute property of this name

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used by the Merge-Markdown cmdlet.

"items": {
"type": "string"
},
"minItems": 1,
"type": "array"
},
"type": {
"type": "string",
"contentType": "markdown"
},
"aliases": {
"type": "string"
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"parameterValueGroup": {
"isDynamic": {
"type": "boolean"
},
"allowedValues": { // parameterValueGroup
"items": {
"type": "string"
},
"minItems": 1,
"type": "array"
},
"parameterSetName": {
"type": "string"
},
"position": {
"type": "string"
},
"defaultValue": {
"type": "string"
},
"pipelineInput": { // change from bool to string, need to change js and template
"type": "string"
},
"acceptWildcardCharacters": {
"type": "boolean"
},
Expand All @@ -194,7 +217,7 @@
"minItems": 1,
"type": "array"
},
"commonParameters": {
"commonParameters": { // This implies has cmdlet binding
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is supposed to be optional. Not all commands implement cmdlet binding.

"type": "string",
"contentType": "markdown",
"tags": ["localizable"]
Expand Down