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

Split validate package #55

Open
2 tasks
fredbi opened this issue Jan 2, 2018 · 0 comments
Open
2 tasks

Split validate package #55

fredbi opened this issue Jan 2, 2018 · 0 comments

Comments

@fredbi
Copy link
Member

fredbi commented Jan 2, 2018

The validate package suports two related but different use-cases:

  • validating swagger specs
  • validating data against schemas

I would say that validating swagger specs is itself broken in:

  • validating a swagger schema
  • running extra rules

This mix of features makes the validate package difficult to document, maintain and guarantee against regression, especially the very sensitive data against schema part, which is used by go-swagger model generator.

In my opinion, we should split the package in two parts:

  • a package dedicated to spec validation, and possibly json-schema validation (errors as go-openapi/validate/Result)
  • a package dedicated to data validation against json schema (errors from go-openapi/errors)

We could achieve that without breaking the existing interfaces using Go 1.9 type aliasing (https://github.com/golang/proposal/blob/master/design/18130-type-alias.md). However, that would break our current commitment for compatibility with 1.8.

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

No branches or pull requests

1 participant