Code Monkey home page Code Monkey logo

Comments (4)

lupestro avatar lupestro commented on August 17, 2024 1

While using Joi, it might not hurt to upgrade from 12.0.0 to 14.3.1 and avoid the dependency deprecation warnings. There were some marginal breaking changes to check your usage against, though...

from json-api-serializer.

danivek avatar danivek commented on August 17, 2024

A schema validator (Joi here) just serves to validate options on type registration. It's only to have prettier errors if developer set a wrong object.

serialize and deserialize functions don't use schema validation, so in term of performance, moving to AJV will not have impact on these functions.

from json-api-serializer.

danivek avatar danivek commented on August 17, 2024

I had rather thought to have an internal validator to ensure that input is correct, so we could remove a dependency on whatever external schema validator.

from json-api-serializer.

faustbrian avatar faustbrian commented on August 17, 2024

One place that I noticed that is slow because of Joi while doing some testing is https://github.com/danivek/json-api-serializer/blob/master/lib/JSONAPISerializer.js#L417.

If you use the serializeError method and have a lot of traffic that results in errors, like a 422, it can take a hit on performance. Overall the use of Joi is fine but I am avoiding the use of serializeError due to that.

An internal validator would be an alternative but it would be questionable if it will be faster then AJV/JSON schema.

from json-api-serializer.

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.