3

I have generated YAML file from Swagger editor and it give me lots of errors corresponding to LocalDate.

Corresponding to this line : $ref: '#/definitions/LocalDate'

I get this error:

Semantic error at definitions.SegmentsIncludeEndCouponScheduleDO.allOf.1.properties.segmentDates.items.$ref $refs must reference a valid location in the document Jump to line 1926

Any pointers on how to resolve this.

Edit:

Just to add some more context. I have an application where we created RESTful Webservice using Spring Boot which was integrated with Swagger. Now we want to integrate it with OpenAPI, so I am trying to generate YAML file from Swagger and then generate java stubs from it.

Vladas Maier
  • 2,054
  • 2
  • 22
  • 34
Lokesh
  • 7,810
  • 6
  • 48
  • 78
  • 1
    1) Can you post the complete YAML file? 2) What do you mean by "YML generated from Swagger UI" and "generated YML file from Swagger editor"? Swagger UI is a documentation renderer, it does not _generate_ anything. Swagger Editor also doesn't generate definitions, it lets you write them manually or load from a file. How did you actually generate the YAML file? Did you write it manually or was it generated from source code by some library such as Swashbuckle, Springfox, Swagger-PHP, etc.? – Helen Dec 27 '18 at 09:24
  • @Helen : Please see my Edit. Sharing full YAML file might not be feasible as its big. But i can answer any queries or paste snippets wherever required. – Lokesh Dec 27 '18 at 09:28
  • Does [this](https://stackoverflow.com/q/40525468/113116) and [this](https://stackoverflow.com/q/41675459/113116) help? It's supposed to replace `$ref: '#/definitions/LocalDate'` with `type: string`. Also see if [this](https://stackoverflow.com/a/28803634/113116) is relevant. – Helen Dec 27 '18 at 09:51
  • It didn't help but it definitely gave me the direction. Thanks – Lokesh Dec 27 '18 at 11:28
  • Did you manage to fix this? I have the same issue. – mor222 Apr 24 '19 at 20:41
  • 1
    I also got this issue :P – Marcus Ekström Feb 26 '20 at 15:50

0 Answers0