Skip to content

OffsetDateTime is not imported with allOf using #128

@romif

Description

@romif

Hello.
I noticed an incorrect model generation for date-time type with allOf using: OffsetDateTime is not imported.

openapi.yaml:

openapi: 3.0.2
info:
  title: openapi-processor-spring sample api
  version: 1.0.0

paths:
  /test:
    get:
      tags:
        - test
      responses:
        '200':
          description: echo of the source parameter
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/Model'

components:
  schemas:
    SubModelWithDateTime:
      type: object
      properties:
        dateTime:
          type: string
          format: date-time

    SubModel:
      type: object
      properties:
        name:
          type: string

    Model:
      type: object
      allOf:
        - $ref: '#/components/schemas/SubModelWithDateTime'
        - $ref: '#/components/schemas/SubModel'

Expected result: all classes are imported.

Actual result: OffsetDateTime is not imported:

package io.openapiprocessor.model;

import com.fasterxml.jackson.annotation.JsonProperty;

public class Model {

    @JsonProperty("dateTime")
    private OffsetDateTime dateTime;

    @JsonProperty("name")
    private String name;

    public OffsetDateTime getDateTime() {
        return dateTime;
    }

    public void setDateTime(OffsetDateTime dateTime) {
        this.dateTime = dateTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions