Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 214
Alias variables block in the Target struct#1748
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
75f252e43325fd6d2f88265f1c757db32fcb899285b023ba0e24725d460eeb900e589608133127c7017939efb70790731f535f67011dfdc0870e4192dea889d07192ffcdccb3e7fd0635b79747ac601632c30cfa483480f727036bacc4309f194a5bad7503a40f4d35aac66874141f4ecb8d6a9578019b176ced13d5c076be0ad488575c4746585bb6bd7ad066cbb54ba3f0049d9c612446463bbfe9cc4a64857e42da1c9d0aa4934379d7fe55df7b1dd399f75a571a8cd2631c69e6d92d62c0c5f48b58ab3dd7a804d3794c3faccd9432e565ed301e1a8e0348af9d1176bb4b507b99df26027a9689a79c365fd43b06a94ed55a23File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -21,6 +21,22 @@ func addInterpolationPatterns(typ reflect.Type, s jsonschema.Schema) jsonschema. | ||
| return s | ||
| } | ||
| // The variables block in a target override allows for directly specifying | ||
| // the value of the variable. | ||
| if typ == reflect.TypeOf(variable.TargetVariable{}) { | ||
| return jsonschema.Schema{ | ||
| AnyOf: []jsonschema.Schema{ | ||
| // We keep the original schema so that autocomplete suggestions | ||
| // continue to work. | ||
| s, | ||
| // All values are valid for a variable value, be it primitive types | ||
| // like string/bool or complex ones like objects/arrays. Thus we override | ||
| // the schema to allow all valid JSON values. | ||
| {}, | ||
Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shreyas-goenka Could we have an integration test for this as well? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do, see: Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the pointer. I was under the assumption the integration tests were merged before this one, which would imply there is no coverage for this case, but it's the other way around, so all good. | ||
| }, | ||
| } | ||
| } | ||
| switch s.Type { | ||
| case jsonschema.ArrayType, jsonschema.ObjectType: | ||
| // arrays and objects can have complex variable values specified. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.