Skip to content

[PowerShell] discard readonly properties in Initialize cmdlets#6754

Merged
wing328 merged 27 commits intoOpenAPITools:masterfrom
Ghufz:ps-discardReadonly
Jun 25, 2020
Merged

[PowerShell] discard readonly properties in Initialize cmdlets#6754
wing328 merged 27 commits intoOpenAPITools:masterfrom
Ghufz:ps-discardReadonly

Conversation

@Ghufz
Copy link
Contributor

@Ghufz Ghufz commented Jun 23, 2020

Discard the readOnly properties for Initialize cmdlets, This can be useful for New and Set cmdlets to deal with only non readonly properties.
To achieve this user needs to add the following in config file.
discardReadOnly: true

PR checklist

  • Read the contribution guidelines.
  • If contributing template-only or documentation-only changes which will change sample output, build the project beforehand.
  • Run the shell script ./bin/generate-samples.shto update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/config/java*. For Windows users, please run the script in Git BASH.
  • File the PR against the correct branch: master
  • Copy the technical committee to review the pull request if your PR is targeting a particular programming language.

@wing328

Ghufz and others added 25 commits April 16, 2020 17:13
…uration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
…uration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
…uration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
…uration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
…uration.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
…ignature_auth.mustache

Co-authored-by: Sebastien Rosset <serosset@cisco.com>
@Ghufz Ghufz changed the title Ps discard readonly [PowerShell] discard readonly properties in Initialize cmdlets Jun 23, 2020
@wing328
Copy link
Member

wing328 commented Jun 23, 2020

Pushed a commit to update the doc. Let's see if that fixes the CI failure.


$PSO = [PSCustomObject]@{

$PSO = [PSCustomObject]@{
Copy link
Member

Choose a reason for hiding this comment

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

FYI. I'll file a separate PR to replace tabs with spaces


// Mark the last readonly false property
if(this.discardReadOnly && lastWritableProperty != null) {
lastWritableProperty.vendorExtensions.put("x-lastWritable", true);
Copy link
Member

Choose a reason for hiding this comment

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

I'll rename the extension to x-ps-last-writable instead to make it conform to the naming convention

@wing328 wing328 added this to the 5.0.0 milestone Jun 25, 2020
@wing328 wing328 merged commit 13fe079 into OpenAPITools:master Jun 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants