Closed tomchristie closed 9 years ago
Does this output look alright?
- {email: jpadilla@example.com, is_staff: true, url: 'http://127.0.0.1:8000/users/1/.yaml',
username: jpadilla}
Ran it through a linter and it looks like this.
---
-
email: jpadilla@example.com
is_staff: true
url: "http://127.0.0.1:8000/users/1/"
username: jpadilla
Not sure. Not touched the yaml renderer since it went in.
Yes that format is correct... http://pyyaml.org/wiki/PyYAMLDocumentation#Dictionarieswithoutnestedcollectionsarenotdumpedcorrectly
Although it's likely that default_flow_style=False
would be a nicer default. (Tho if that change does get made then let's make sure to highlight it as a difference when we release 3.1, and ensure it's easy enough to change by subclassing YAMLRenderer
)
@tomchristie yeah I'm setting default_flow_style=False
to be the default behavior for the renderer.
@tomchristie how about adding default_flow_style
as a property on YAMLRenderer
so if someone wanted the old behavior they'd just do:
class UglyYAMLRenderer(YAMLRenderer):
default_flow_style = True
Yup that'd be fine. We can then document that in the "use django-rest-framework-yaml
now" section of the 3.1 release notes.
Great! Although note the build failures due to the style change.
@tomchristie already took care of those, updated docs, and release v1.0.2
Rockin'
Probably be worthwhile to include an example of the yaml output in the index.md and README.md