adonisjs / validator

Schema based validator for AdonisJS
MIT License
116 stars 39 forks source link

feat: add bigint type validation #176

Closed MaximeMRF closed 12 months ago

MaximeMRF commented 1 year ago

Proposed changes

Adding the bigint type to the adonisjs validator. This pr is more complete that the other pr but i'm open to work together with @paoloevan if he want

Types of changes

Checklist

Further comments

If the pr is accepted I engage my to provide to docs related to the bigint validation

RomainLanz commented 1 year ago

Hey @MaximeMRF! 👋🏻

Thanks for your PR! I have added a few remarks about your changes.

If we merge this, we need to ensure serialization works correctly with BigInt during HTTP response and add some notes in the Lucid documentation to correctly cast the value depending on the DBMS used.

MaximeMRF commented 1 year ago

Hello @RomainLanz

I have also add remarks about your remarks :) Yes, I engage me to add the bigint validation to the documentation if this pr is merged.

MaximeMRF commented 1 year ago

Hello @RomainLanz

Some tests doesn't pass but I think it's not my fault.

RomainLanz commented 1 year ago

Should we also allow to cast numbers to bigint?

MaximeMRF commented 1 year ago

Yeah, it's a good idea

MaximeMRF commented 1 year ago

Hey @RomainLanz, I've added the cast of a number to bigint type, it is ok now ?

RomainLanz commented 12 months ago

Thanks!