-
-
Notifications
You must be signed in to change notification settings - Fork 346
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(msw): do not use spread objects if
nullable
object schema in `o…
…neOf` (#1626) * fix(msw): not use unnecessary spread object when nullable object schema * chore: add test case
- Loading branch information
1 parent
d9fcfd5
commit 261f8de
Showing
2 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
openapi: 3.0.0 | ||
info: | ||
version: 1.0.0 | ||
title: AnyOf Schema | ||
license: | ||
name: MIT | ||
|
||
paths: | ||
/one-of-with-nullable-object: | ||
get: | ||
operationId: getOneOfWithNullableObject | ||
tags: | ||
- pets | ||
description: |- | ||
oneOf with nullable object. | ||
responses: | ||
'200': | ||
description: Pet | ||
content: | ||
application/json: | ||
schema: | ||
$ref: '#/components/schemas/Pet' | ||
|
||
components: | ||
schemas: | ||
Pet: | ||
oneOf: | ||
- $ref: '#/components/schemas/Dog' | ||
- $ref: '#/components/schemas/Cat' | ||
Dog: | ||
type: object | ||
nullable: true | ||
required: | ||
- id | ||
- name | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
name: | ||
type: string | ||
Cat: | ||
type: object | ||
required: | ||
- id | ||
- category | ||
properties: | ||
id: | ||
type: integer | ||
format: int64 | ||
category: | ||
type: string |