Git Product home page Git Product logo

Comments (5)

daveshanley avatar daveshanley commented on June 15, 2024

Hi,

Have you seen this?

https://github.com/pb33f/libopenapi-validator/blob/main/requests/request_body.go#L26

and

https://github.com/pb33f/libopenapi-validator/blob/main/paths/paths.go#L22

The top level validator does not give you control over things like this, however the individual validators do.

from libopenapi-validator.

daveshanley avatar daveshanley commented on June 15, 2024

I think some better docs will help here.

from libopenapi-validator.

zekth avatar zekth commented on June 15, 2024

I did find those; I'd rather stick to the use of path. I was throwing this as in the code it already does this path check in the validateRequest function:

if v.foundPath == nil {
pathItem, errs, pathValue = paths.FindPath(request, v.v3Model)
if pathItem == nil || errs != nil {
v.errors = errs
return false, errs
}
v.foundPath = pathItem
v.foundPathValue = pathValue
} else {
pathItem = v.foundPath
pathValue = v.foundPathValue
}

If i want to do composition like describe i'd have preferred to not repeat the operation twice. However i think it's better this way than to rebuild an adhoc composed validation function.

from libopenapi-validator.

daveshanley avatar daveshanley commented on June 15, 2024

Would IsPathMissingError() bool as a method on errors.ValidationError work?

from libopenapi-validator.

zekth avatar zekth commented on June 15, 2024

Looks good to me

from libopenapi-validator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.