-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed as not planned
Description
Steps to reproduce
class ASerializer(serializers.Serializer):
name = serializers.CharField()
class BSerializer(serializers.Serializer):
name = serializers.CharField()
animal = ASerializer()Expected behavior
Expose parameters from nested serializers. A custom docs/link.html template allowed me to expose at least one level pretty easy by doing:
{% for field in link.fields|with_location:'form' %}
<tr>
<td class="parameter-name"><code>{{ field.name }}</code>{% if field.required %} <span class="label label-warning">required</span>{% endif %}</td><td>{% if field.schema.description %}{{ field.schema.description }}{% endif %}</td>
{% if field.schema.properties %}
{% for name, nested_field in field.schema.properties.iteritems %}
<tr><td class="parameter-name" style="padding-left: 25px;"><code>{{ name }}</code>{% if nested_field.required %} <span class="label label-warning">required</span>{% endif %}</td><td>{% if nested_field.schema.description %}{{ nested_field.schema.description }}{% endif %}</td></tr>
{% endfor %}
{% endif %}
</tr>
{% endfor %}
Stripe's API Reference handles this pretty nice and I think is something we could look up to for reference.
Actual behavior
pavel-shabarin, grantmcconnaughey, m1kola, simonschmidt, zbyte64 and 14 moreauvipy, vishes-shell, simonschmidt, larsclaussen, carlosgoce and 4 more


