openapi-generators / openapi-generators/openapi-python-client
Handle "empty" default values as null
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Python
- Estrelas
- 2k
- Forks
- 293
- Merge médio
- 34min
- PRs com merge (30d)
- 1
Descrição
Describe the bug
"empty" default values for optional fields throw an error. swagger-parser explicitly allows these (even though they are technically out-of-spec) by converting them silently to null. So, there exist openapi json in the wild built by swagger tools that pass swagger validation, but throw an error here in openapi-python-client.
OpenAPI Spec File
https://www.marinespecies.org/rest/api-docs/openapi.yaml
grep for:
schema:
type: integer
default: ""
There are three endpoints that have this property. One of which is AphiaTaxonRanksByID. It might be useful to check this endpoint out in the swagger docs here.
Desktop (please complete the following information):
- openapi-python-client version 0.28.0
Additional context
I am in contact with the folks at WORMS to try and find out how their openapi.yaml got this way. Will update here when I get more info.
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.
Direção de pesquisa
Reproduza a falha com o arquivo OpenAPI de espécies marinhas vinculado na issue, especialmente os schemas que contêm type: integer e default: "". Rastreie como os valores padrão de campos opcionais são tratados durante a geração do cliente e compare o comportamento com o tratamento indicado do swagger-parser. Considera-se concluído quando os endpoints afetados são gerados com sucesso e os valores padrão vazios são tratados como null.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- openapi, python
- Domínio
- backend-api-design, devtools
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100