swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.36k stars 2.17k forks source link

RFC: Improved support for JSONSchema route hosting #4658

Open cdaringe opened 2 months ago

cdaringe commented 2 months ago

Problem

I need a JSONSchema URL to type some entity (such as a JSONFile, yaml file), e.g.:

{
  "$schema": "https://petstore.com/api/schemas/foo/bar",
  "bar": { ... }
}

...but such a standard in the swagger specification doesn't exist.

Without this capability, I cannot enable great features like intellisense in my IDE without first downloading the swagger.json and performing a transformation.

Discussion

Desired, example behavior:

curl https://petstore.com/api/schemas/SCHEMA_NAME # or similar

{ # JSONSchema document just for that SCHEMA_NAME
  ...
}