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

validate without error when i using invalidated keys #562

Closed
WestEnlarged opened this issue Jun 30, 2022 · 2 comments
Closed

validate without error when i using invalidated keys #562

WestEnlarged opened this issue Jun 30, 2022 · 2 comments

Comments

@WestEnlarged
Copy link

WestEnlarged commented Jun 30, 2022

i'm not sure someone point this, or maybe need someting.

i add some error key in my spec, like this:

openapi: 3.0.0
info:
  version: 3.0.0
  description: test desc
  license:
    name: test
  title: test title
  errorkey: "abc"
paths:
  /hello:
    get:
      description: hello world.
      operationId: hello
      x-apisix-service_id: service1
      responses:
        '200':
          description: list response
        default:
          description: unexpected error

and get expected error when i put this spec on Swagger Editor
image

But, when i execute my test like this, no error return.

bytes := ReadFile(t, "myspec.yaml")
	loader := openapi3.NewLoader()
	openapi, err := loader.LoadFromData(bytes)
	assert.NoError(t, err)
	err = openapi.Validate(loader.Context)
	assert.NoError(t, err)

Maybe it's a bug or a feature request?


and request body on get , show get error but passed.
image

@fenollp
Copy link
Collaborator

fenollp commented Jul 29, 2022

Hi!
Thanks for reporting, indeed you've found another instance of #513
Good news! I have a few leads that should fix this master...fenollp:kin-openapi:issue513 but this should take some more time.

@AnatolyRugalev
Copy link
Contributor

Duplicate of #513

@fenollp fenollp closed this as completed Jul 4, 2024
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

3 participants