Closed datenimperator closed 13 years ago
Did I reply on this? I'm on board with this, just not sure about delivering YAML as JSON. Can we back out of that?
Also, we should update the "test_project" with a few test files.
Hm, my email reply didn't get to here? I wasn't sure about YAML, either. However, YAML mixins allow to build bigger data structures more easily, so I figured it might be a good idea.
---
base: &base
occupation: 'Thief'
weapon: 'Revolver'
data:
- firstname: 'Joe'
lastname: 'Dalton'
<<: *base
- firstname: 'Averell'
lastname: 'Dalton'
<<: *base
which gives us a data structure of
{
"base": {
"weapon": "Revolver",
"occupation": "Thief"
},
"data": [
{
"firstname": "Joe",
"lastname": "Dalton",
"weapon": "Revolver",
"occupation": "Thief"
},
{
"firstname": "Averell",
"lastname": "Dalton",
"weapon": "Revolver",
"occupation": "Thief"
}
]
}
Yeah, I can see the advantage.
Perhaps the extensions for YAML/JSON parsing should be .json.yml and .json.yaml. I don't want to override regular YAML files just for this.
If you will rebase on jlong/master, add some test files to test_project, and fix the extension issue for YAML, I'll merge.
To test dynamic components serve needs to properly handle responses in json format. The patch adds a file handler that will serve files with extension .json as such, and parse YAML files .yml to send the results as json, too.