0

I'm new in swagger. I have a few yaml files and I try to genetare code, using swagger plugin in Intellij. When I generate it, I have errors cannot find symbol. The symbol that he can't find is

TS29510NnrfNFManagementYamlcomponentsschemasFqdn

But this is wrong. Really he is looking for symbol

$ref: TS29510_Nnrf_NFManagement.yaml#/components/schemas/Fqdn

Fqdn is not generated (I think because it's type is not object). But why generator can't find this symbol?

In yaml Fqdn looks like this:

Fqdn:
  type:
    - string
    - array
  items: {}
Igor_M
  • 308
  • 2
  • 12
  • _"I think because it's type is not object"_. Nope, it's because `type` is a list of types rather than a single type. Type list is supported in OpenAPI 3.1 (the latest OpenAPI Specification version released in February 2021) but is not supported in OpenAPI 3.0 and 2.0. – Helen Jun 23 '21 at 10:08
  • @Helen how can I check version of OpenAPI? I use swagger-codegen-maven-plugin of version 3.0.25. But I don't explicitly include OpenAPI. – Igor_M Jun 23 '21 at 11:01
  • 1
    OpenAPI version is specified in your YAML file itself: `openapi: 3.x.x` is OpenAPI 3, `swagger: '2.0'` is OpenAPI 2. According to the info in your question, you use **OpenAPI 3.0**. – Helen Jun 23 '21 at 11:57

1 Answers1

1

You basically answered yourself. Object Fqdn is invalid that's why it can't generated or referenced. Simply change object declaration and enjoy working code :)

Fqdn:
  type: object
  properties:
    items:
      type: array
      items:
        type: string
Piotr Solarski
  • 316
  • 2
  • 6