mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 10:46:54 +00:00
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 = {};
|
||||
|
||||
if (primaryKey) {
|
||||
const primaryKeyField = collection.fields.get(primaryKey);
|
||||
if (!primaryKeyField) {
|
||||
throw new Error(`primaryKeyField not found: ${primaryKey}, ${collection.name}`);
|
||||
}
|
||||
|
||||
Object.assign(parameters, {
|
||||
collectionIndex: {
|
||||
required: true,
|
||||
|
@ -52,11 +52,17 @@ export class SwaggerManager {
|
||||
'hidden.$isFalsy': true,
|
||||
},
|
||||
});
|
||||
|
||||
for (const collection of collections) {
|
||||
if (collection.name === 'roles') {
|
||||
continue;
|
||||
}
|
||||
|
||||
try {
|
||||
others = merge(others, this.collection2Swagger(collection.name, false));
|
||||
} catch (e) {
|
||||
this.app.log.error(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
return merge(base, others);
|
||||
|
Loading…
Reference in New Issue
Block a user