kokuwaio/micronaut-openapi-codegen

generator failes with the OneOf feature

rpahli opened this issue · 0 comments

I tryed to generate so code bacause it failes with a missing class OneOfIdentifiableTenantIdentifiableDeviceVO. maybe you can check it.

openapi: 3.0.2
info:
  title: Administration Device Registry API
  description: |
    This API defines some extension methods for the hono device registry API.
  version: 1.0.0


servers:
- url: '{url}'
  description: 'External address.'
  variables:
    url:
      default: '/'
- url: http://localhost:8080
  description: 'Local development server.'

components:
  schemas:
    IdentifiableTenant:
      type: object
      additionalProperties: false
      properties:
        "id":
          type: string
        "tenant":
          $ref: 'device-registry-v1.yaml#/components/schemas/Tenant'
      required:
        - id
          - tenant
    IdentifiableDevice:
      type: object
      additionalProperties: false
      properties:
        "id":
          type: string
        "tenant":
          type: string
        "device":
          $ref: 'device-registry-v1.yaml#/components/schemas/Device'
      required:
        - id
        - device
    PageableList:
      type: object
      additionalProperties: false
      required:
        - items
        - total
      properties:
        "total":
          $ref: '#/components/schemas/Total'
        "length":
          $ref: '#/components/schemas/Length'
        "offset":
          $ref: '#/components/schemas/Offset'
        "items":
          type: array
          items:
            oneOf:
              - $ref: '#/components/schemas/IdentifiableTenant'
              - $ref: '#/components/schemas/IdentifiableDevice'
    Total:
      type: number
      description: Count of listes items in the response.
    Length:
      type: integer
      description: Length of the response list.
    Offset:
      type: integer
      description: Offeset to start the response list at.
  parameters:
    length:
      description: Length of the response list.
      name: length
      in: query
      required: false
      schema:
        type: integer
        default: 100
        minimum: 1
        maximum: 1000
      example: 10
    offset:
      description: Offeset to start the response list at.
      name: offset
      in: query
      required: false
      schema:
        type: integer
        default: 0
        minimum: 0
      example: 0
    name:
      description: Name of the tenant as defined by there additionalProperties field.
      name: name
      in: query
      required: false
      schema:
        type: string
      example: 'kiwigrid'
    query:
      description: the query to be used when searching devices through extension property values.
      name: query
      in: query
      required: false
      schema:
        type: string
      example: 'EMX-0'

  headers:
    Total:
      description: Total number of currently available objects.
      schema:
        type: integer
      example: 100

paths:
  /admin/tenants:
    get:
      tags:
        - tenants
      summary: Get all tenants that are currently registerd with their Id's.
      operationId: getTenants
      parameters:
        - $ref: '#/components/parameters/length'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/name'
      responses:
        200:
          description: operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageableList'
        400:
          $ref: 'device-registry-v1.yaml#/components/responses/MalformedRequest'
        401:
          $ref: 'device-registry-v1.yaml#/components/responses/Unauthorized'
        403:
          $ref: 'device-registry-v1.yaml#/components/responses/NotAllowed'

  /admin/{tenantId}/devices:
    parameters:
      - $ref: 'device-registry-v1.yaml#/components/parameters/tenantId'
    get:
      tags:
        - devices
      summary: Get all devices that are currently registerd for the tenant with their Id's.
      operationId: getDevicesForTenant
      parameters:
        - $ref: '#/components/parameters/length'
        - $ref: '#/components/parameters/offset'
        - $ref: '#/components/parameters/query'
      responses:
        200:
          description: operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageableList'
          headers:
            Total:
              $ref: '#/components/headers/Total'
        400:
          $ref: 'device-registry-v1.yaml#/components/responses/MalformedRequest'
        401:
          $ref: 'device-registry-v1.yaml#/components/responses/Unauthorized'
        403:
          $ref: 'device-registry-v1.yaml#/components/responses/NotAllowed'
        404:
          $ref: 'device-registry-v1.yaml#/components/responses/NotFound'
  /credentials/{tenantId}/{deviceId}:
    post:
      tags:
      - admin
      summary: Add credentials for registered device
      operationId: addCredentials
      parameters:
      - $ref: 'device-registry-v1.yaml#/components/parameters/tenantId'
      - $ref: 'device-registry-v1.yaml#/components/parameters/deviceId'
      requestBody:
        content:
          application/json:
            schema:
              $ref: 'device-registry-v1.yaml#/components/schemas/TypedCredentials'
      responses:
        204:
          $ref: 'device-registry-v1.yaml#/components/responses/Updated'
        400:
          $ref: 'device-registry-v1.yaml#/components/responses/MalformedRequest'
        401:
          $ref: 'device-registry-v1.yaml#/components/responses/Unauthorized'
        403:
          $ref: 'device-registry-v1.yaml#/components/responses/NotAllowed'
        404:
          $ref: 'device-registry-v1.yaml#/components/responses/NotFound'