Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fl034/c24adc469b154dc61e8b70b5f969bc28 to your computer and use it in GitHub Desktop.
Save fl034/c24adc469b154dc61e8b70b5f969bc28 to your computer and use it in GitHub Desktop.
OpenAPI Generator Kotlin Array at Root Level Bug
openapi: 3.0.0
info:
title: API
description: Testing arrays at root level in kotlin
version: 1.0.0
paths:
/myObjectsAtRootLevel:
get:
tags:
- Not parsable to List<SubObject>
summary: Retrieve array of objects at root level
responses:
'200':
description: Results
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SubObject'
/myObjectsEncapuslated:
get:
tags:
- Parsable to MyObject containing List<SubObject>
summary: Retrieve array of objects encapsulated in object
responses:
'200':
description: Results
content:
application/json:
schema:
$ref: '#/components/schemas/MyObject'
components:
schemas:
MyObject:
type: object
properties:
title:
type: string
children:
type: array
items:
$ref: '#/components/schemas/SubObject'
required:
- title
SubObject:
type: object
properties:
title:
type: string
required:
- title
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment