apispec icon indicating copy to clipboard operation
apispec copied to clipboard

RFC: Remove validate_spec feature

Open lafrech opened this issue 5 years ago • 5 comments

See discussions in https://github.com/marshmallow-code/apispec/pull/299.

No strong feeling either way. Indeed, it probably works for most users, and anyone unhappy about the default values may install and call prance independently, so this implementation at least serves the purpose of showing how to do it.

lafrech avatar Oct 08 '18 21:10 lafrech

We can leave this issue open for discussion, but I'm going to remove this from the 1.0 milestone in the interest of cutting scope.

sloria avatar Oct 23 '18 02:10 sloria

Recent CI issues are due to changes in openapi_spec_validator 0.5.x, which is a dependency of prance. Until prance releases a fix, we should pin openapi_spec_validator<0.5 for the "validation" extra requires.

I wouldn't mind removing the feature from the public API and only keeping it internally for the tests. I admit this wouldn't solve the whole issue, just make it less of a problem to modify dependency versions without it being a breaking change. Also, if there hasn't been any issue in 4 years, maybe I'm overreacting.

My point is that if it is only used for the test, we are free to change versions, even the lib used internally, even remove the whole thing without notice, so it makes maintenance a bit easier.

Nobody has :+1: or :-1: since I opened this RFC so perhaps nobody cares.

lafrech avatar Sep 13 '22 12:09 lafrech

Just run into this issue as I went to update openapi-spec-validator to 0.5.1, was about to raise an issue here but stumbled upon this thread. ImportError: cannot import name 'validate_v2_spec' from 'openapi_spec_validator'. The prance issue: https://github.com/RonnyPfannschmidt/prance/issues/131

SpeeddY avatar Sep 21 '22 14:09 SpeeddY

Yes, I saw that issue. I should have linked to it. Thanks.

Does this mean you're using the feature and you're :-1: about removing it?

In practice the feature doesn't provide much more than an abstraction for the validation frameworks. Anyone can install any validator on their own.

lafrech avatar Sep 21 '22 16:09 lafrech

We are using the feature but it would be an easy refactor to remove it (the refactor would use the new "detecting version validate_spec" method from openapi-spec-validator)

If you go ahead with this RFC I presume you can remove the openapi-spec-validator dependency entirely? (I am not a downvote) If you decided to keep it, it would be great if it could work with the latest openapi-spec-validator

SpeeddY avatar Sep 22 '22 09:09 SpeeddY