Closed adam-codeberg closed 8 years ago
What happens when you try validating your RAML file: ramlfications validate /path/to/file.raml
?
ramlfications validate /path/to/file.raml returns
ValueError: Expecting property name: line 29 column 13 (char 783)
Line 29 is this section (marked by * )
- item_owner_acl:
description: ACL that allows everyone to read, authenticated to create and item owners to edit item
type: x-ACL
settings:
collection: |
*allow g:admin all
allow everyone view,options
allow authenticated create
item: |
allow g:admin all
allow authenticated view,options
Running the same validation check on the latest ramses-example from git returns
Error validating file example.raml:
InvalidSecuritySchemeError: 'settings' for security scheme 'x_token_auth' require definition.
pip list
attrs (15.1.0)
blinker (1.4)
click (6.2)
cryptacular (1.4.1)
elasticsearch (2.1.0)
inflection (0.3.1)
jsonref (0.1)
markdown2 (2.3.0)
mongoengine (0.9.0)
nefertari (0.6.1)
nefertari-sqla (0.4.1)
PasteDeploy (1.5.2)
pbkdf2 (1.3)
pip (7.1.2)
psycopg2 (2.6.1)
pymongo (2.8)
pyramid (1.6b2)
pyramid-sqlalchemy (1.4)
pyramid-tm (0.12.1)
python-dateutil (2.4.2)
PyYAML (3.11)
ramlfications (0.1.8)
ramses (0.5.1)
repoze.lru (0.6)
requests (2.8.1)
setuptools (18.2)
simplejson (3.8.1)
six (1.10.0)
SQLAlchemy (1.0.9)
SQLAlchemy-Utils (0.31.3)
Tempita (0.5.2)
termcolor (1.1.0)
transaction (1.4.4)
translationstring (1.3)
urllib3 (1.12)
venusian (1.0)
WebOb (1.5.1)
wheel (0.24.0)
xmltodict (0.9.2)
zope.deprecation (4.1.2)
zope.dottedname (4.1.0)
zope.interface (4.1.3)
zope.sqlalchemy (0.7.6)
I've managed to bypass the "Expecting property name" error by modifying parts of my RAML file, however the error
InvalidSecuritySchemeError: 'settings' for security scheme 'x_token_auth' require definition.
Has no known workaround.
I'm not up to speed with RAML specs and largely dependant on the conventions I saw in the ramses-examples etc, any ideas?
Reference for myself & others: https://github.com/raml-org/raml-spec/blob/master/raml-0.8.md
I copy/pasted the raml file above and aside from 2 unrelated errors that were straight-forward to fix, ramlfications validate file.raml
returned "Success! Valid RAML file: file.raml". The only thing that I can think of is that there may be tabs on or around line 29 in your file and when you copy/pasted it, it converted those tabs into spaces which explains why it works for me...
Yeah the copy/paste messed up some spacing. I also removed some duplicate collections hoping that was it, but didn't have any luck.
I get the same InvalidSecuritySchemeError error with the raml from ramses-example.
Can you paste your pip list? I would like to compare and try validating the file with your python library stack.
attrs (15.1.0)
blinker (1.4)
click (6.2)
cryptacular (1.4.1)
elasticsearch (2.1.0)
inflection (0.3.1)
jsonref (0.1)
markdown2 (2.3.0)
mongoengine (0.9.0)
nefertari (0.6.1)
nefertari-mongodb (0.4.1)
nefertari-sqla (0.4.1)
Paste (2.0.2)
PasteDeploy (1.5.2)
pbkdf2 (1.3)
pip (7.1.2)
psycopg2 (2.6.1)
pymongo (2.8)
pyramid (1.5.7)
pyramid-sqlalchemy (1.4)
pyramid-tm (0.12.1)
python-dateutil (2.4.2)
PyYAML (3.11)
ramlfications (0.1.8)
ramses (0.5.1)
ramses-example (0.0.1)
repoze.lru (0.6)
requests (2.8.1)
setuptools (18.2)
simplejson (3.8.1)
six (1.10.0)
SQLAlchemy (1.0.9)
SQLAlchemy-Utils (0.31.3)
Tempita (0.5.2)
termcolor (1.1.0)
transaction (1.4.4)
translationstring (1.3)
urllib3 (1.12)
venusian (1.0)
waitress (0.8.9)
WebOb (1.5.1)
wheel (0.24.0)
xmltodict (0.9.2)
zope.deprecation (4.1.2)
zope.dottedname (4.1.0)
zope.interface (4.1.3)
zope.sqlalchemy (0.7.6)
Oh, I get that error too, quick fix is to add a (dummy) "settings" section:
...
- x_token_auth:
description: Authorization header token policy
type: x-ApiKey
settings:
foo: bar
...
Oh right, got it, thanks for that! Will implement those changes and report back.
Yeah the errors were due to invalid RAML v8. Wsgi server now loads. Cheers!
Thanks the update!
Not sure why ramlfications v 0.1.8 throws these errors when 0.1.5 works fine.