Improve 3.1+ schema `$id` UX
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Stack de tecnologia
- json
- Domínio
- api
Direção de pesquisa
Comece comparando as definições existentes schema e schema-base da OAS 3.1, incluindo como dialect/base e meta/base são referenciados. Considera-se concluído quando um schema com um nome intuitivo fornece a validação padrão do Schema Object, permite que recursos incorporados alternem entre metaschemas e torna mais evidente o comportamento incompleto de schema.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Currently, we have the following schema document $ids for OAS 3.1 (shown relative to a base URI of https://https://spec.openapis.org/oas/3.1/, and without the trailing date segment that all schemas need to support updates:
schema# Validates everything except the Schema Object, which is only validated againsttype: [boolean, object]schema-base# Extendsschemato validate Schema Objects againstdialect/baseand require both$schemaandjsonSchemaDialectto be set toschema's$idif they are presentdialect/base# A dialect equivalent to the default 2020-12 dialect plus the OAS extensionsmeta/base# The vocabulary metaschema for the OAS extensions
schema-base was named to indicate that it incorporates dialect/base. No one is certain why the dialect and vocabulary are referred to as "base", but they are called that in the OAS text as well. I vaguely recall discussing the dialect as a base for further OAS-relevant extensions? Perhaps that is what the intent was.
AFAICT, the advantage of schema is that it's self-contained. But giving it that name means that it is the schema that most people assume is what they want, yet it really does not produce the behavior they'd expect.
schema-base is closer to what people would expect, but is (in my view) overly restrictive in locking $schema to dialect/base, as it is valid to switch metaschemas if $schema appears alongside $id, and conforming JSON Schema implementations know to treat $id-containing subschemas as embedded resources and check for a changed metaschema. However, this does not make schema-base wrong: Users might indeed want to enforce using only dialect/base, and this is the correct way to do that.
On the other hand (and contrary to some of my comments earlier on Slack), schema-base locking jsonSchemaDialect to dialect/base is probably correct. If you want to set jsonSchemaDialect to something else, you would want a schema that validates Scheam Objects accordingly by default.
We probably shouldn't change how schema behaves, but we should make it more obvious that it is incomplete. We should also come up with some sort of intuitive name for a schema that is like schema-base but does not restrict $schema. This name needs to convey that most users will want this new schema, and not the plain schema.
Ideally, I'd prefer to make copies of the vocabulary and dialect and give them the URIs dialect/oas and meta/oas (3.1 is already present earlier in the URI), but that is probably more trouble than it is worth given that I imagine very few people pay attention to those other than to just load them correctly when using schema-base.
The important thing is to have an intuitively-named schema that performs the default accepted Schema Object validation but still allows switching metaschemas on embedded resources. That is the default behavior of the OAS, and it's not currently provided.
- Linguagem predominante
- Markdown
- Estrelas
- 31.2k
- Forks
- 9.2k
- Merge médio
- 2d 9h
- PRs com merge (30d)
- 17
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de OAI/OpenAPI-Specification
-
Housekeeping
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 45/100
OAI/OpenAPI-Specification#5566 ·
Mantenedores costumam responder em até 1 dia
-
Housekeeping
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 35/100
OAI/OpenAPI-Specification#5562 · 4 comentários ·
Mantenedores costumam responder em até 1 dia
-
Housekeeping
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 10/100
OAI/OpenAPI-Specification#5556 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
v3.2.1 releaseTalvez livre de novo @lornajane assumiu há 32 dias e não há nenhum pull request aberto. Aberta
OAI/OpenAPI-Specification#5460 · 11 comentários · 1 reação · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
param serialization
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
OAI/OpenAPI-Specification#5366 · 12 comentários ·
Mantenedores costumam responder em até 1 dia
Todas as issues de OAI/OpenAPI-Specification
Issues semelhantes
-
nextjs-tracking
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 69/100
cloudflare/vinext#3920 ·
Mantenedores costumam responder em até 1 dia
-
cloning objets from planningAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 65/100
glpi-project/glpi#25922 ·
Mantenedores costumam responder em até 1 dia
-
unbounded value for n in `/v1/logs` can panic/OOMTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertasmall item
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
canonical/pebble#1127 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
beginner friendly community contributions-welcome good first issue hacktoberfest health help wanted up-for-grabs
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
StackExchange/StackExchange.Redis#3274 ·
Mantenedores costumam responder em até 1 dia