cloudflare / chanfana

OpenAPI 3 and 3.1 schema generator and validator for Hono, itty-router and more!
https://chanfana.pages.dev
MIT License
302 stars 40 forks source link

Request support for YAML auto generation of OpenAPI #111

Closed Nativu5 closed 8 months ago

Nativu5 commented 9 months ago

As some services (e.g., 文心一言 from Baidu) require openapi.yaml but we only have openapi.json now, I am wondering if we can add support for generating a YAML spec and serving it?

vasinl124 commented 8 months ago

would be nice, but for the workaround I just copy/paste .json file into this editor and it automatically generate yaml file for you https://editor.swagger.io/

Nativu5 commented 8 months ago

would be nice, but for the workaround I just copy/paste .json file into this editor and it automatically generate yaml file for you https://editor.swagger.io/

Thanks for your reply. I know it's easy to convert OpenAPI specs from .json to .yaml. However, some services (namely, 文心一言 from Baidu) only accept an online specs, which means I can't copy/paste it.

I understand Baidu's design is bit nerdy. But if we have this feature, definitely it would be more flexible and timesaving.

G4brym commented 8 months ago

Hey there, i've just publish a new release v1.0.8 that adds support for this, in /openapi.yaml or in the specified openapi_url path Let me know if you have more suggestions