fix(@angular/cli): handle oneOf when converting schema to yargs options#32554
Open
terencehonles wants to merge 1 commit intoangular:mainfrom
Open
fix(@angular/cli): handle oneOf when converting schema to yargs options#32554terencehonles wants to merge 1 commit intoangular:mainfrom
oneOf when converting schema to yargs options#32554terencehonles wants to merge 1 commit intoangular:mainfrom
Conversation
…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.
d03daeb to
57a8100
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Options such as
--allowed-hostsare defined asoneOf([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
oneOfis placed at the root of the option schema rather than in an array'sitems. 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?
This will affect any commands for each of the options that use
oneOfat 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