1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 19:05:55 +02:00

fix(backend): correct invalid schema format specifying only required for anyOf (#16089)

* fix(backend): correct invalid schema format specifying only `required` for `anyOf`

* refactor(backend): make types derived from `allOf` or `anyOf` more strong
This commit is contained in:
zyoshoka
2025-05-27 08:57:09 +09:00
committed by GitHub
parent ed3a844f5d
commit d27075c5f5
16 changed files with 394 additions and 252 deletions

View File

@@ -89,7 +89,8 @@ export function genOpenapiSpec(config: Config, includeSelfRef = false) {
schema.required = undefined;
}
const hasBody = (schema.type === 'object' && schema.properties && Object.keys(schema.properties).length >= 1);
const hasBody = (schema.type === 'object' && schema.properties && Object.keys(schema.properties).length >= 1)
|| ['allOf', 'oneOf', 'anyOf'].some(o => (Array.isArray(schema[o]) && schema[o].length >= 0));
const info = {
operationId: endpoint.name.replaceAll('/', '___'), // NOTE: スラッシュは使えない