vine icon indicating copy to clipboard operation
vine copied to clipboard

Question: How to make vine work with hyphenated column name

Open jasonejavier opened this issue 1 year ago • 5 comments

Package version

^2.0.0

Describe the bug

On our AdonisJS model we have a hyphenated column name like this

Screenshot 2024-05-06 at 8 18 00 AM

And we declare it in our consts file like this:

Screenshot 2024-05-06 at 8 19 03 AM

Vine declaration

Screenshot 2024-05-06 at 8 19 34 AM

We're using the vinejs for checking the body for the CREATE request and when we're passing "avs-address": "Sample Address",

it is giving us the error: SyntaxError: Missing initializer in const declaration

Can someone help with this? Thank you!

Reproduction repo

No response

jasonejavier avatar May 06 '24 00:05 jasonejavier

Having the same issue, seems caused by a failure to compile the async function that validates the field

joao-pedro-braz avatar May 20 '24 18:05 joao-pedro-braz

Does that fix the issue when you convert the fields to camelCase?

https://vinejs.dev/docs/schema_101#converting-the-output-to-camelcase

RomainLanz avatar May 20 '24 19:05 RomainLanz

Not sure I entirely get the issue. So it will be nice to have a reproduction of the same

thetutlage avatar Jun 02 '24 11:06 thetutlage

Not sure I entirely get the issue. So it will be nice to have a reproduction of the same

The code generated by Vine when using kebab-case field is invalid. The issue reside inside the compiler. Maybe we should normalize the casing of the field inside the generated code.

RomainLanz avatar Jun 02 '24 11:06 RomainLanz

The code generated by Vine when using kebab-case field is invalid

That is what I am trying to figure out. What is invalid?

  • Does it throw a runtime exception? If yes, what does that exception looks like?
  • Does it not validate the field altogether? If yes, will need a reproduction

thetutlage avatar Jun 02 '24 12:06 thetutlage