mirror of
https://github.com/paricafe/misskey.git
synced 2025-01-22 02:48:40 -06:00
fix(backend): clone schema before converting to OAS schema to avoid mutation (#15294)
* fix(backend): clone schema before converting to OAS schema to avoid mutation * Update CHANGELOG.md * fix: use deepClone
This commit is contained in:
parent
b16f5a781e
commit
1ef62e9e33
2 changed files with 4 additions and 1 deletions
|
@ -59,6 +59,7 @@
|
|||
- Fix: AIセンシティブ判定が arm64 環境で動作しない問題を修正
|
||||
- Fix: 非Misskey系のソフトウェアからHTML`<ruby>`タグを含むノートを受信した場合、MFMの読み仮名(ルビ)文法に変換して表示
|
||||
- Fix: 連合OFFで投稿されたノートに対する冗長な処理を抑止 ( #15018 )
|
||||
- Fix: `/api.json`のレスポンスが2回目のリクエスト以降おかしくなる問題を修正
|
||||
|
||||
### Misskey.js
|
||||
- Feat: allow setting `binaryType` of WebSocket connection
|
||||
|
|
|
@ -3,13 +3,15 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { deepClone } from '@/misc/clone.js';
|
||||
import type { Schema } from '@/misc/json-schema.js';
|
||||
import { refs } from '@/misc/json-schema.js';
|
||||
|
||||
export function convertSchemaToOpenApiSchema(schema: Schema, type: 'param' | 'res', includeSelfRef: boolean): any {
|
||||
// optional, nullable, refはスキーマ定義に含まれないので分離しておく
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
const { optional, nullable, ref, selfRef, ...res }: any = schema;
|
||||
const { optional, nullable, ref, selfRef, ..._res }: any = schema;
|
||||
const res = deepClone(_res);
|
||||
|
||||
if (schema.type === 'object' && schema.properties) {
|
||||
if (type === 'res') {
|
||||
|
|
Loading…
Reference in a new issue