Fix issue with schema generation when datasource is undefined
This commit is contained in:
parent
e37e5d137c
commit
953c6b13bf
|
@ -536,12 +536,14 @@ export const getSchemaForDatasource = (asset, datasource, options) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add schema properties if required
|
// Add schema properties if required
|
||||||
|
if (schema) {
|
||||||
if (addId) {
|
if (addId) {
|
||||||
schema["_id"] = { type: "string" }
|
schema["_id"] = { type: "string" }
|
||||||
}
|
}
|
||||||
if (addRev) {
|
if (addRev) {
|
||||||
schema["_rev"] = { type: "string" }
|
schema["_rev"] = { type: "string" }
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure there are "name" properties for all fields and that field schema
|
// Ensure there are "name" properties for all fields and that field schema
|
||||||
// are objects
|
// are objects
|
||||||
|
|
Loading…
Reference in New Issue