ngx-form-generator
ngx-form-generator copied to clipboard
Crash when schema object type is array
According to the OpenAPI spec: "The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays."
However, ngx-form-generator crashes when the schema is of type array.
node_modules/@verizonconnect/ngx-form-generator/dist/generator-lib.js:52
const fields = Object.keys(definition.properties);
^
TypeError: Cannot convert undefined or null to object
...
A schema Object example from the OpenAPI spec with an array:
animals:
type: array
items:
type: string
{
"animals": {
"type": "array",
"items": {
"type": "string"
}
}
}
Or:
Cdns:
type: array
items:
type: string
$ref: "#/components/schemas/Cdn"
Thanks,
Arjen