parent
58a04ce1a5
commit
5fb0a995dd
37 changed files with 59 additions and 49 deletions
|
@ -37,7 +37,7 @@ export const meta = {
|
|||
},
|
||||
|
||||
type: {
|
||||
validator: $.optional.str.match(/^[a-zA-Z\/\-\*]+$/)
|
||||
validator: $.optional.str.match(/^[a-zA-Z\/\-*]+$/)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ export const meta = {
|
|||
},
|
||||
|
||||
type: {
|
||||
validator: $.optional.str.match(/^[a-zA-Z\/\-\*]+$/)
|
||||
validator: $.optional.str.match(/^[a-zA-Z\/\-*]+$/)
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ for (const endpoint of endpoints) {
|
|||
} else {
|
||||
if (endpoint.name.includes('-')) {
|
||||
// 後方互換性のため
|
||||
router.post(`/${endpoint.name.replace(/\-/g, '_')}`, handler.bind(null, endpoint));
|
||||
router.post(`/${endpoint.name.replace(/-/g, '_')}`, handler.bind(null, endpoint));
|
||||
}
|
||||
router.post(`/${endpoint.name}`, handler.bind(null, endpoint));
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ export function convertSchemaToOpenApiSchema(schema: Schema) {
|
|||
const res: any = schema;
|
||||
|
||||
if (schema.type === 'object' && schema.properties) {
|
||||
res.required = Object.entries(schema.properties).filter(([k, v]) => v.optional !== true).map(([k]) => k);
|
||||
res.required = Object.entries(schema.properties).filter(([k, v]) => !v.optional).map(([k]) => k);
|
||||
|
||||
for (const k of Object.keys(schema.properties)) {
|
||||
res.properties[k] = convertSchemaToOpenApiSchema(schema.properties[k]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue