OAI / OAI/OpenAPI-Specification

JSON Schema path pattern

Open
#2,417 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Schema
Dominant language
Markdown
Stars
31.2k
Forks
9.2k
Avg merge
6h 37m
Merged PRs (30d)
27

Description

Can you explain why there is an escape character before / in json schema of openapi specification?

https://github.com/OAI/OpenAPI-Specification/blob/master/schemas/v3.0/schema.json#L793

I tried to find a reason why it's there in https://json-schema.org/understanding-json-schema/reference/regular_expressions.html and https://www.ecma-international.org/publications/standards/Ecma-262.htm but i'm still not sure about it. I didn't find any explanation in specs.

IMO this regexp is invalid, it only works in most of libraries because javascript automatically fixes invalid usages of escape character.

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

Start at schemas/v3.0/schema.json line 793 and compare the path pattern with the JSON Schema regular-expression guidance and ECMAScript specification linked in the issue. Determine whether the escaped slash is valid and why it is present; done means documenting the rationale or clearly identifying the required schema correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
api
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.