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 Jan 20, 2024. It is now read-only.
Following the tutorial in http://apiworkbench.com/docs/ for Api-workbench, section "Extracting the Library". I'm getting the following error "JS-YAML: missed comma between flow collection entries at line" in several lines (which I've put in bold)
My RAML files are
#%RAML 1.0
title: Pet Shop
version: v1
baseUri: /petshop
mediaType:
application/json
description: API example designed with API Workbench
@joaocarreiras YAML is a whitespace sensitive language, and as you made your post there is no indentation (which I am guessing is not correct) and we cannot tell what your input is. Could edit and correct your post? You will probably want to use fenced code blocks.
consts=`key: [ Some text hereand another line here ]`safeLoad(s)// throws YAMLException: missed comma between flow collection entries at line 2, column 1
Although the online YAML parser parses this as:
{
"key": [
"Some text here and another line here"
]
}
Hi,
Following the tutorial in http://apiworkbench.com/docs/ for Api-workbench, section "Extracting the Library". I'm getting the following error "JS-YAML: missed comma between flow collection entries at line" in several lines (which I've put in bold)
My RAML files are
#%RAML 1.0
title: Pet Shop
version: v1
baseUri: /petshop
mediaType:
description: API example designed with API Workbench
uses:
NewLibrary: NewLibrary.raml
types:
Mammal:
type: NewLibrary.Pet
Bird:
type: NewLibrary.Pet
properties:
wingLength: number
/pets:
type: { NewLibrary.Collection: {item : NewLibrary.Pet }
get:
queryParameters:
petKind:
enum: [bird, mammal]
is: [NewLibrary.FilterableByPrice]
/{id}:
type: { NewLibrary.Member: {item : NewLibrary.Pet} }
/birds:
type: { NewLibrary.Collection: {item: Bird} }
get:
is: NewLibrary.FilterableByPrice
/{id}:
type: { NewLibrary.Member: {item : Bird} }
/mammals:
type: { NewLibrary.Collection: {item: Mammal} }
get:
is: NewLibrary.FilterableByPrice
/{id}:
type: { NewLibrary.Member: {item : Mammal} }
The "NewLibrary.raml" is below
#%RAML 1.0 Library
types:
Pet:
#discriminator: kind
properties:
name: string
kind: string
price: number
color:
enum:
- White
- Black
- Colored
example:
name: Snoopy
kind: Mammal
price: 100
color: Black
resourceTypes:
Collection:
post:
body:
application/json:
type: <>
get:
responses:
200:
body:
application/json:
type: <>[]
Member:
delete:
responses:
204:
put:
body:
application/json:
type: <>
traits:
FilterableByPrice:
queryParameters:
priceLessThan?:
type: number
priceMoreThan?:
type: number
I've no idea why this error appears. I've compared it with the tutorial and can't find the difference
The text was updated successfully, but these errors were encountered: