1
0
Fork 0
mirror of synced 2024-09-11 23:16:00 +12:00

Fix issue with schema generation when datasource is undefined

This commit is contained in:
Andrew Kingston 2022-02-17 09:25:02 +00:00
parent e8d5d54f5d
commit c858b9341f

View file

@ -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