$ref: 'https://teamdigitale.github.io/openapi/0.0.7/definitions.yaml#/schemas/Latitude'
tutto funziona alla perfezione e anche la validazione dello YAML viene eseguita senza problemi.
Il problema si presenta quando, dallo Swagger Editor o dal SwaggerHub, provo a generare le classi per creare un Client; o piu' semplicemente quando, sempre da SwaggerHub, chiedo di esportarmi lo "YAML Resolved" cioè con la risoluzione di tutte le referenze esterne. Facendo queste operazioni ottengo un errore di:
Error.Cannot parse invalid API definition, please fix any syntax issues
Ho aperto un Ticket con lo "SmartBear Customer Care" e questa e' la loro risposta:
From: SmartBear Customer Care <[email protected]>
Subject: Case #00490372: SwaggerHub chat from [email protected] on 09/15/2021 08:02 GMT
Date: 17 September 2021 at 17:28:29 CEST
To: "[email protected]" <[email protected]>
Hi Valentino,
This message is a follow-up to our recent chat regarding some issues when downloading a resolved version of the Dante Web Services specification.
Most likely, the issues are caused by external references specified in the documentation, like this one:
$ref: 'https://ingv.github.io/openapi/definitions.yaml#/parameters/starttime'
and by external references specified in the referenced definitions.yaml file itself, like this one:
$ref: 'https://teamdigitale.github.io/openapi/0.0.7/definitions.yaml#/schemas/Latitude'
Both definitions.yaml files are not valid specification or domain files. They have a structure similar to a common specification or a domain, but they still miss some important fields like the root openapi object, the components object, and so on, so cannot be parsed properly. Please adjust referenced files according to the OAS format requirements and try to download the specification afterward. Does it make any difference?
Please refer to the following help topic for details on the specification and domain structure:
https://swagger.io/docs/specification/basic-structure/
https://support.smartbear.com/swaggerhub/docs/domains/oas3-domain-example.html
Regards,
Julia Kolosova
Customer Care Engineer
e vedo se il problema e' questo.