AST YAML to API Blueprint md: A resource is missing URI template error
_version: 1.0
metadata:
FORMAT:
value: 1A
name: <API name>
description: <API description>
resourceGroups:
- name: <resource group name>
description: <resource group description>
resources:
- name: <resource name>
description: <resource description>
uriTemplate: /testResource/{id}
…
…
Error message: Invalid input: A resource is missing URI template ('<resource name>' resource)
Anything I'm doing wrong in the above YAML AST?
_version: 1.0
metadata:
FORMAT:
value: 1A
name: <API name>
description: <API description>
resourceGroups:
- name: <resource group name>
description: <resource group description>
resources:
- name: <resource name>
description: <resource description>
uriTemplate: /testResource/{id}
This composes for me into:
FORMAT: 1A
# <API name>
<API description>
# Group <resource group name>
<resource group description>
## <resource name> [/testResource/{id}]
<resource description>
Please check the indentation of your input.
I copied the same yaml and tested it out again. I get the same error: Invalid input: A resource is missing URI template ('<resource name>' resource) ..
Is there any restriction on spaces being indented with the correct number ? Like 2 or 4?
Am I running the compiler correctly?
I just use : matter_compiler -f yaml test.yaml
I tried one more time with the simple API example ..
snowcrash simpleAPI.apib -f json -o testJSON.json
OK.matter_compiler -f json testJSON.json
Invalid input: A resource is missing URI template
Don't know if its a platform specific issue. I am using Mac OSX 10.8.5 and ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0] and matter_compiler version 0.4.0.
Same with JSON files & also tested this in Ubuntu:
uname -a
Linux3.8.0-35-generic #50~precise1-Ubuntu SMP Wed Dec 4 17:25:51 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux matter_compiler -f json simpleapi.json
Invalid input: A resource is missing URI template
I went back to version 0.3.0 git checkout 20f425d, and it works. I guess, the latest changes broke the build?
Will leave it open for you to comment.
@rrarunan
Strange it works on our systems; I won't have time to investigate it until mid next week Since you can reproduce it it would be great if you can look into this issue and try to fix it. I would start investigating at line 449 of blueprint.rb
Thanks for help!