Skip to content

Comments

fix(@angular/cli): handle oneOf when converting schema to yargs options#32554

Open
terencehonles wants to merge 1 commit intoangular:mainfrom
terencehonles:update-yargs-parsing
Open

fix(@angular/cli): handle oneOf when converting schema to yargs options#32554
terencehonles wants to merge 1 commit intoangular:mainfrom
terencehonles:update-yargs-parsing

Conversation

@terencehonles
Copy link

PR Checklist

Please check to confirm your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Other... Please describe:

What is the current behavior?

Options such as --allowed-hosts are defined as oneOf([array<string>, boolean]) but the array option is not chosen, even though it is first, because the JSONSchema conversion only supports an array at the root of the option schema.

Issue Number: N/A

What is the new behavior?

This change fixes JSONSchemas where oneOf is placed at the root of the option schema rather than in an array's items. This allows an array to be passed via the command-line, but additional types to be represented via configuration.

Does this PR introduce a breaking change?

  • Yes
  • No

This will affect any commands for each of the options that use oneOf at the root of their schemas. This change does not change the precedence of schema definition, so if there are any changes and they are not wanted then it is just uncovering a bug where the preferred type should have been ordered first.

Other information

…ions

This change fixes JSONSchemas where `oneOf` is placed at the root of the
schema rather than in an array's `items`. This allows an array to be
passed via the command-line, but additional types to be represented via
configuration.
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.

1 participant