swagger-api / swagger-api/swagger-core

RFC: Improved support for JSONSchema route hosting

Open
#4,658 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
Dominant language
Java
Stars
7.5k
Forks
2.3k
Avg merge
18h 1m
Merged PRs (30d)
10

Description

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

  • Hosting a dedicated route(s) for supplying raw JSONSchema would be an excellent addition to the core offerring.
  • We go to great lengths to build JSONSchema models, but we don't expose them in their natural form.
  • JSONSchema likes to be hosted at URIs that produce raw/idiomatic JSONSchema: https://json-schema.org/understanding-json-schema/structuring#schema-identification, which is helpful for integrating with some tools

Desired, example behavior:

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

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no implementation files, tests, or entry points. Start by reviewing the linked JSON Schema structuring guidance and the existing schema-generation behavior; done means a route such as /api/schemas/SCHEMA_NAME returns the selected schema as raw, idiomatic JSONSchema.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.