chore: catch api doc collection error
This commit is contained in:
parent
1e0bedca86
commit
60b0fdd5ca
@ -7,6 +7,11 @@ export default (collection: Collection) => {
|
|||||||
const parameters = {};
|
const parameters = {};
|
||||||
|
|
||||||
if (primaryKey) {
|
if (primaryKey) {
|
||||||
|
const primaryKeyField = collection.fields.get(primaryKey);
|
||||||
|
if (!primaryKeyField) {
|
||||||
|
throw new Error(`primaryKeyField not found: ${primaryKey}, ${collection.name}`);
|
||||||
|
}
|
||||||
|
|
||||||
Object.assign(parameters, {
|
Object.assign(parameters, {
|
||||||
collectionIndex: {
|
collectionIndex: {
|
||||||
required: true,
|
required: true,
|
||||||
|
@ -52,11 +52,17 @@ export class SwaggerManager {
|
|||||||
'hidden.$isFalsy': true,
|
'hidden.$isFalsy': true,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const collection of collections) {
|
for (const collection of collections) {
|
||||||
if (collection.name === 'roles') {
|
if (collection.name === 'roles') {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
others = merge(others, this.collection2Swagger(collection.name, false));
|
|
||||||
|
try {
|
||||||
|
others = merge(others, this.collection2Swagger(collection.name, false));
|
||||||
|
} catch (e) {
|
||||||
|
this.app.log.error(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return merge(base, others);
|
return merge(base, others);
|
||||||
|
Loading…
Reference in New Issue
Block a user