GithubHelp home page GithubHelp logo

Comments (8)

aboutlo avatar aboutlo commented on June 26, 2024 1

I imagined as a type in order to accept an arbitrary valid JSON.
In your example I don't get the benefit. it could be S.definition(S.raw({ foo: 'bar'}))

from fluent-json-schema.

aboutlo avatar aboutlo commented on June 26, 2024

fluent-schema doesn't support custom AJV keywords. we had a similar discussion here: #16

To be fair, I'm not sure if it's a good idea to add not standard keywords related to a specific validator (e.g. AJV).

Regardless can you give an example of API that would you like to use

from fluent-json-schema.

firasdib avatar firasdib commented on June 26, 2024

@aboutlo Okay. I wanted to add a specific type/keyword to be able to manipulate the data to my needs in a generic way.

from fluent-json-schema.

aboutlo avatar aboutlo commented on June 26, 2024

maybe we could think something like that.

S.object()
  .prop('foo', S.integer())
  .prop('myKeyword', S.raw({true})

//cc @mcollina @Eomm

from fluent-json-schema.

Eomm avatar Eomm commented on June 26, 2024

Is S.raw a type or could be attached like prop?

S.object()
  .prop('foo', S.integer())
  .prop('myKeyword', S.raw('true')
  .raw({$def:S.object().valueOf()})

And the input could be:

  • a json => an will be that will be spread
  • a string/bool/num => and will be used as value
    ?

from fluent-json-schema.

firasdib avatar firasdib commented on June 26, 2024

Unless I've missed something, adding support for this would allow us to use the nullable feature in AJV/OpenAPI, which I currently don't think is possible with fluent schema.

from fluent-json-schema.

aboutlo avatar aboutlo commented on June 26, 2024

Yes, any feature outside JSON Schema spec isn't currently supported

from fluent-json-schema.

aboutlo avatar aboutlo commented on June 26, 2024

Moved the conversation here: #55

from fluent-json-schema.

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.