mirror of
https://github.com/thegeneralist01/twitter-openapi
synced 2026-01-11 23:50:26 +01:00
build
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
parent
305609f839
commit
b6c703fa7b
4 changed files with 18 additions and 3 deletions
1
dist/compatible/schemas/instruction.yaml
vendored
1
dist/compatible/schemas/instruction.yaml
vendored
|
|
@ -46,7 +46,6 @@ components:
|
|||
content:
|
||||
$ref: ./content.yaml#/components/schemas/ContentUnion
|
||||
entryId:
|
||||
pattern: ^[a-z\-]+[0-9]+$
|
||||
type: string
|
||||
sortIndex:
|
||||
pattern: '[0-9]+$'
|
||||
|
|
|
|||
1
dist/docs/schemas/instruction.yaml
vendored
1
dist/docs/schemas/instruction.yaml
vendored
|
|
@ -46,7 +46,6 @@ components:
|
|||
content:
|
||||
$ref: ./content.yaml#/components/schemas/ContentUnion
|
||||
entryId:
|
||||
pattern: ^[a-z\-]+[0-9]+$
|
||||
type: string
|
||||
sortIndex:
|
||||
pattern: '[0-9]+$'
|
||||
|
|
|
|||
|
|
@ -162,7 +162,7 @@ components:
|
|||
$ref: "./content.yaml#/components/schemas/ContentUnion"
|
||||
entryId:
|
||||
type: string
|
||||
pattern: '^[a-z\-]+[0-9]+$'
|
||||
# pattern: '^[a-z\-]+[0-9]+$'
|
||||
sortIndex:
|
||||
type: string
|
||||
pattern: "[0-9]+$"
|
||||
|
|
|
|||
|
|
@ -109,6 +109,23 @@ class RemoveDiscriminator(SchemasHookBase):
|
|||
return value
|
||||
|
||||
|
||||
class ReplaceLegacyDiscriminator(SchemasHookBase):
|
||||
def hook(self, value: dict):
|
||||
if value.get("oneOf") is not None:
|
||||
value = {
|
||||
"type": "object",
|
||||
"example": ",".join(
|
||||
list(x["$ref"].split("/")[-1] for x in value["oneOf"])
|
||||
),
|
||||
# "required": [value["discriminator"]["propertyName"]],
|
||||
"properties": {
|
||||
f"oneOf_schema_{x}_validator": y
|
||||
for x, y in enumerate(value["oneOf"])
|
||||
},
|
||||
}
|
||||
return value
|
||||
|
||||
|
||||
# RequestHookBase extends
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue