Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI schema validation #233

Open
fajfer opened this issue Jan 14, 2022 · 1 comment
Open

OpenAPI schema validation #233

fajfer opened this issue Jan 14, 2022 · 1 comment
Milestone

Comments

@fajfer
Copy link
Contributor

fajfer commented Jan 14, 2022

Hey, thank you for creating this repository, I really like it on paper and hopefully I'll be able to utilize and contribute as much as I can :)

I just spend a good amount of time wondering why my schema doesn't work, I've validated it using Redocly OpenAPI extension in VSCode, I've used Swagger editor and validated (as the error suggests) using openapi-spec-validator package. Turns out my scheme is ok but rororo would not accept it anyway, to have some context this is the error I'm speaking about:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File ".py", line 10, in run
    return setup_openapi(
  File "/lib/python3.8/site-packages/rororo/openapi/openapi.py", line 726, in setup_openapi
    raise ConfigurationError(
rororo.openapi.exceptions.ConfigurationError: Unable to load valid OpenAPI schema in openapi.yaml. In most cases it means that given file doesn't contain valid OpenAPI 3 schema. To get full details about errors run `openapi-spec-validator /home/centos/git/omni/devops/odra/src/openapi.yaml`

I've been trying to break/fix my code in many ways but managed to fix it by adding quotation marks to every string in my file, so instead of doing this (which is acceptable by all other validators):

  contact:
    name: Damian Fajfer

rororo requires me to write it with quotation marks:

  contact:
    name: "Damian Fajfer"

My guess is there's no reason for enforcing quotation marks and both versions should work, correct?

@playpauseandstop playpauseandstop added this to the 4.0 milestone Aug 9, 2022
@playpauseandstop
Copy link
Owner

@fajfer

Yeah, your assumption is correct,

  contact:
    name: Damian Fajfer

is completely correct OpenAPI schema, my only guess the error caused by obsolete version of openapi-spec-validator, which still supported by rororo, but I plan to fix this in #149

If you're still interested, please buckle up 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants