-
-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scribe sends integers as strings in JSON? #640
Comments
It's probably because when you're reading a text input in HTML, every value is a string (and Scribe doesn't do any conversion). The fix would probably be to render a
|
Thanks for the reply. Will need to fix this |
Okay, I'm wrong. We do set it. scribe/resources/views/components/field-details.blade.php Lines 19 to 23 in 195c897
I think it's the HTML/JS. IIRC, reading an input value in JS always gives you a string, even if the input type is number. |
Do we have a workaround to send booleans from Scribe UI? and select the parameter via Scribe API UI: I get the following error: When I try to debug with the following: I get this result, saying it is not boolean, but rather string: What I finally did as a workaround is adding the type as Enum in the codeblock as the following: And Scribe UI becomes like: It still gets sent as string, but at least Laravel validates it to be a boolean. It is not very handsome comparing to radio switch though 😉 |
PRs appreciated |
fixed in 4.35.0 |
Hi everyone.
Looks like scribe doesn't work properly with integer type when sending JSON?
My annotations look like this (see
id
type):Resulting request:
Looks like Scribe still wraps integers into quotes?
Or is there any option to change this behaviour? I would like it to send integer as integer instead (see
id
andpercentage
):The text was updated successfully, but these errors were encountered: