Invalid URL (jsonschema RefResolutionError)
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Start at jsonschema.validators.resolve_from_url and trace how openapi-core invokes jsonschema for the YAML $ref './paths.yaml'. Confirm how relative references are resolved against the current directory, then verify that the example paths.yaml reference resolves without RefResolutionError.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
We probably should install an extra handler for jsonschema, one that prepends file:// and resolves the current directory to all relative file name references. The relevant code that errors out:
# jsonschema.validators
def resolve_from_url(self, url):
url, fragment = urldefrag(url)
try:
document = self.store[url]
except KeyError:
try:
document = self.resolve_remote(url)
except Exception as exc:
raise RefResolutionError(exc)
return self.resolve_fragment(document, fragment)
The code in question:
openapi: 3.0.1
servers:
- url: 'https://example.com/api/v2.0/'
info:
title: Example API
description: Our awesome example API
version: 1.1.0
tags:
- name: Service
paths:
$ref: './paths.yaml'
I have also tried file://./paths.yaml, which then results in it looking for /paths.yaml, which is an error of the file resolver jsonschema is using. Either way, we currently cannot resolve any relative file references, which are allowed and correctly working in other tools, including openapi-spec-validator. The latter is a bit odd, since it should be resolving references and validating them.
- Linguagem predominante
- Python
- Estrelas
- 368
- Forks
- 140
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
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 python-openapi/openapi-core
-
kind/bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
python-openapi/openapi-core#1188 · 2 comentários ·
-
kind/bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
python-openapi/openapi-core#1225 · 2 comentários ·
-
kind/bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 76/100
python-openapi/openapi-core#1212 ·
-
[Bug]: Query parameter validation fails to match empty string when listed as a valid enum value Abertakind/bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 68/100
python-openapi/openapi-core#1210 ·
-
kind/bug kind/bug/confirmed
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 58/100
python-openapi/openapi-core#1180 · 3 comentários ·
Todas as issues de python-openapi/openapi-core
Issues semelhantes
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
canonical/paas-charm#368 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
tech debt
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
-
addition to tracking list Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
StevenBlack/hosts#3256 ·
-
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 90/100
qualcomm/qai-appbuilder#275 ·