You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
post:
description: Instantiate a new relationship schemaoperationId: instantiateRelationshipSchemarequestBody:
description: Relationship schema to createrequired: truecontent:
application/json:
schema:
$ref: '#/components/schemas/InstantiateRelationshipSchema'multipart/form-data:
schema:
$ref: '#/components/schemas/InstantiateRelationshipSchema'
The issue appears only when using the multipart/form-data side and submitting strings for the vertex_a and vertex_b. I've identified the offending code:
jx.DecodeStr(val) - val is a raw un-quoted string value which the decoder can't parse e.g. if I submit a multipart/form-data request with abc123 as vertex_a then val at #L253 will be abc123... However the jx Decoder is expecting a JSON string token: "abc123". Hence the invalid json type error.
I've fixed my issue for now by removing the oneOf for the vertexes and only allowing the string version.
The text was updated successfully, but these errors were encountered:
adrianduke
changed the title
gen: jx.DecodeStr passed unquoted string value and fails
jx.DecodeStr passed unquoted string value and fails
Feb 7, 2024
I've got a situation where I'm getting the following response:
The schema in question looks like the following:
And my usage is on the following endpoint:
The issue appears only when using the
multipart/form-data
side and submitting strings for thevertex_a
andvertex_b
. I've identified the offending code:ogen/gen/_template/request_decode.tmpl
Lines 246 to 253 in 3ae5daa
jx.DecodeStr(val)
-val
is a raw un-quoted string value which the decoder can't parse e.g. if I submit amultipart/form-data
request withabc123
asvertex_a
thenval
at #L253 will beabc123
... However the jx Decoder is expecting a JSON string token:"abc123"
. Hence theinvalid
json type error.I've fixed my issue for now by removing the
oneOf
for the vertexes and only allowing the string version.The text was updated successfully, but these errors were encountered: