feature: support for Parameter.content (#5571)

* add `getParameterSchema` OAS helper

* use `Parameter.content.[firstKey].schema` as schema value when present

* `newValue` -> `initialValue`

* make `paramWithMeta` a const

* add trailing comma to `swagger2SchemaKeys`

* refactor `helpers` to a folder

* deprecate `src/core/utils.js` in favor of `src/core/helpers/`

* support `Parameter.content.[mediaType].schema` in validateParam

* reject `null` as an OAS3 object value

* expose Fetch errors in the browser console

* generate ParameterRow default values based on `content` values

* add tests for `getParameterSchema`

* remove debugger statement

* remove debugger statement

* don't apply `generatedSampleValue`s to parameters with `examples`

* remove extra semi

* disable JSON check in parameter runtime validation

* stringify JsonSchema_object textarea values

* add Cypress tests

* swagger-client@3.9.4
This commit is contained in:
kyle
2019-08-31 16:37:43 -07:00
committed by GitHub
parent 24c6473990
commit c9c3b2338e
11 changed files with 400 additions and 52 deletions

View File

@@ -412,15 +412,15 @@ describe("utils", function() {
})
assertValidateOas3Param(param, value, [])
// invalid object-as-string
param = {
required: true,
schema: {
type: "object"
}
}
value = "{{}"
assertValidateOas3Param(param, value, ["Parameter string value must be valid JSON"])
// // invalid object-as-string
// param = {
// required: true,
// schema: {
// type: "object"
// }
// }
// value = "{{}"
// assertValidateOas3Param(param, value, ["Parameter string value must be valid JSON"])
// missing when required
param = {
@@ -456,14 +456,14 @@ describe("utils", function() {
})
assertValidateOas3Param(param, value, [])
// invalid object-as-string
param = {
schema: {
type: "object"
}
}
value = "{{}"
assertValidateOas3Param(param, value, ["Parameter string value must be valid JSON"])
// // invalid object-as-string
// param = {
// schema: {
// type: "object"
// }
// }
// value = "{{}"
// assertValidateOas3Param(param, value, ["Parameter string value must be valid JSON"])
// missing when not required
param = {