Skip to content

oneOf & anyOf: does not work in schema object #134

Closed

Description

@SENIAN

OpenAPI Spec:

        ResponseMessage:
                type: object
                properties:
                    correlationId:
                        type: string
                    resultCode:
                        type: integer
                    resultDetails:
                        $ref: '#/components/schemas/MessageDetails'
                    reference:
                        oneOf:
                        - $ref: '#/components/schemas/x'
                        - $ref: '#/components/schemas/y'
                        - $ref: '#/components/schemas/z'
Compilation error:

[ERROR] target/generated-sources/com/cc/rest/api/model/ResponseMessage.java:[56,33] cannot find symbol
[ERROR]   symbol:   class ResponseMessageRfsReference
[ERROR]   location: class com.cc.rest.api.model.ResponseMessage

Activity

  1. hauner commented on Aug 11, 2021

    @hauner
    Member

    Hmm, ResponseMessageRfsReference looks funny, wondering where the Rfs part is coming from. I'll take a look.

  2. hauner commented on Aug 12, 2021

    @hauner
    Member

    I can reproduce the issue with your response description, missing class/import in my case is ResponseMessageReference.

    I have a test case using oneOf which runs, but it is not using the oneOf nested in an object property:

        FooOneOf:
          oneOf:
            - $ref: '#/components/schemas/One'
            - $ref: '#/components/schemas/Two'
            - $ref: '#/components/schemas/Three'

    Looks like that's not handled properly.

    Thanks for reporting :-)

  3. modified the milestones: , on Aug 13, 2021
  4. modified the milestones: , core: 2022.5.2 on Aug 28, 2021
  5. modified the milestones: core: 2021.5.2, 2021.6 on Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions