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
{{ message }}
This repository has been archived by the owner on May 10, 2024. It is now read-only.
Hi. I got issue on validation when trying to pass multiple query parameters to resource in object.
Here is an error that validator produces { code: 'SCALAR_PROHIBITED', message: 'Property \'queryParameters\' can not have scalar value' }
What's weird that if i pass single parameter everything works as expected.
Here is my raml code
/api/ier:
type: {
stx-get: {
queryData: {
test: {
type: integer,
description: some desc
}
},
typeName : AnalyticsFeedsCount,
desc: Get amount of available analytics feeds in IER server
}
}
And the resource part
stx-get:
usage: Use this resourceType for GET routes
get:
queryParameters: <<queryData>>
description: <<desc>>
is:
- hasResponseItem: {typeName: <<typeName>>}
If queryData have only single key it passes and if multiple it will fail with SCALAR_PROHIBITED message.
Now if i just write object in resourceType everything works.
stx-get:
usage: Use this resourceType for GET routes
get:
queryParameters: {
test: {
type: integer,
description: some desc
},
page: {
type: string,
required: false
}
}
description: <<desc>>
is:
- hasResponseItem: {typeName: <<typeName>>}
When i try to debug. I found that raml-1-parser module causing this issue.
To be exactly dist/parser/ast.core/linter.js method validateBasicFlat
This code returns error:
if (node.lowLevel().value() != '~') {
if (!checkIfIncludeTagIsMissing(node, v, messageRegistry.SCALAR_PROHIBITED.code, false)) {
v.accept(createIssue1(messageRegistry.SCALAR_PROHIBITED, { propName: node.name() }, node));
}
}
I just cant seem to understand what am i missing.
Query parameters allow object to be passed in, but for some reason when i pass it as an argument it fails.
Hi. I got issue on validation when trying to pass multiple query parameters to resource in object.
Here is an error that validator produces
{ code: 'SCALAR_PROHIBITED', message: 'Property \'queryParameters\' can not have scalar value' }
What's weird that if i pass single parameter everything works as expected.
Here is my raml code
And the resource part
If queryData have only single key it passes and if multiple it will fail with SCALAR_PROHIBITED message.
Now if i just write object in resourceType everything works.
When i try to debug. I found that raml-1-parser module causing this issue.
To be exactly dist/parser/ast.core/linter.js method validateBasicFlat
This code returns error:
I just cant seem to understand what am i missing.
Query parameters allow object to be passed in, but for some reason when i pass it as an argument it fails.
Also when checking styling with https://github.com/raml2html/raml2html everything works fine with all approaches.
Thank you for help.
The text was updated successfully, but these errors were encountered: