Skip to content

Commit

Permalink
add pets union test yml file
Browse files Browse the repository at this point in the history
  • Loading branch information
koros committed May 22, 2024
1 parent 15a5140 commit 9b27708
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions tests/Kiota.Builder.Tests/OpenApiSampleFiles/PetsUnion.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
namespace Kiota.Builder.Tests.OpenApiSampleFiles;


public static class PetsUnion
{
public static readonly string OpenApiYaml = @"
openapi: 3.0.0
info:
title: Pet API
version: 1.0.0
paths:
/pets:
patch:
summary: Update a pet
requestBody:
required: true
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/Cat'
- $ref: '#/components/schemas/Dog'
discriminator:
propertyName: pet_type
responses:
'200':
description: Updated
components:
schemas:
Pet:
type: object
required:
- pet_type
properties:
pet_type:
type: string
discriminator:
propertyName: pet_type
Dog:
allOf:
- $ref: '#/components/schemas/Pet'
- type: object
properties:
bark:
type: boolean
breed:
type: string
enum: [Dingo, Husky, Retriever, Shepherd]
required:
- pet_type
- bark
- breed
Cat:
allOf:
- $ref: '#/components/schemas/Pet'
- type: object
properties:
hunts:
type: boolean
age:
type: integer
required:
- pet_type
- hunts
- age";
}

0 comments on commit 9b27708

Please sign in to comment.