Coder Social home page Coder Social logo

Comments (7)

jhthorsen avatar jhthorsen commented on September 17, 2024

I'm not sure if I can fix this, since there's no good definition of "false" in YAML. I think you need to take this with the author of YAML.

Please re-open if you have an idea for how to fix this or how to make a workaround.

from mojolicious-plugin-openapi.

ugexe avatar ugexe commented on September 17, 2024

i would think one of two things would work:

  1. Translate the Yaml to Json, followed by populating the default value (so the default is applied to the json and not the yaml

  2. Use introspection after the initial translation - if the type is "boolean" and has an invalid Boolean default it could refer to the original yaml doc and try to extract a truthy or falsey value to be re-applied

from mojolicious-plugin-openapi.

ugexe avatar ugexe commented on September 17, 2024

The swagger tools all seem to cope with this, so I would think they are doing something similar

from mojolicious-plugin-openapi.

ugexe avatar ugexe commented on September 17, 2024

I can't reopen this issue. Also even if you can't fix it I'm not sure you should close the issue as it only hides the problem from others who may encounter it.

from mojolicious-plugin-openapi.

jhthorsen avatar jhthorsen commented on September 17, 2024

I won't leave issues open that I can't fix.

The problem is that the YAML library converts the word "true" and "false" into something that isn't really a boolean value. What I would like is if the author of the YAML library would convert booleans into JSON::PP::false and ::true objects.

from mojolicious-plugin-openapi.

jhthorsen avatar jhthorsen commented on September 17, 2024

It's really just guesswork. At some point I considered dropping YAML support completely, but I kept supporting it, even if I don't like/use YAML myself.

from mojolicious-plugin-openapi.

jhthorsen avatar jhthorsen commented on September 17, 2024

Actually... You're right: In this case it's not guesswork. Sorry, I think vacation has made me confused :/

from mojolicious-plugin-openapi.

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.