django-rest-swagger nested serializers with readonly fields not rendered properlyDjango REST framework: non-model serializerid field in django rest framework serializerHow can I apply a filter to a nested resource in Django REST framework?django-rest-framework and swagger api documentationDjango Rest Framework: Dynamically return subset of fieldsDoes django-rest-swagger not work well with modelserializers?read_only field in django rest serializer with unique_together contraintNested annotate fields in Django REST Framework serializersHow to specify a query parameter serializer in django-rest-swagger?Nested URL not showing in Django Rest Swagger

What kind of world would drive brains to evolve high-throughput sensory?

What is the best word describing the nature of expiring in a short amount of time, connoting "losing public attention"?

how to add 1 milliseconds on a datetime string?

German phrase for 'suited and booted'

Do I care if the housing market has gone up or down, if I'm moving from one house to another?

If hash functions append the length, why does length extension attack work?

Origin of the suffix in hippocampus

Killing a star safely

Can a creature sustain itself by eating its own severed body parts?

Why are Oscar, India, and X-Ray (O, I, and X) not used as taxiway identifiers?

What is a "staved" town, like in "Staverton"?

Contact Search Results Address Type

Is the apartment I want to rent a scam?

Why did computer video outputs go from digital to analog, then back to digital?

Is an easily guessed plot twist a good plot twist?

Company requiring me to let them review research from before I was hired

How does mathematics work?

What's the 1 inch size square knob sticking out of wall?

How often should alkaline batteries be checked when they are in a device?

How can Kazakhstan perform MITM attacks on all HTTPS traffic?

Has Peter Parker ever eaten bugs?

High income and difficulty during interviews

Bounded Torsion, without Mazur’s Theorem

What does the following chess proverb mean: "Chess is a sea where a gnat may drink from and an elephant may bathe in."



django-rest-swagger nested serializers with readonly fields not rendered properly


Django REST framework: non-model serializerid field in django rest framework serializerHow can I apply a filter to a nested resource in Django REST framework?django-rest-framework and swagger api documentationDjango Rest Framework: Dynamically return subset of fieldsDoes django-rest-swagger not work well with modelserializers?read_only field in django rest serializer with unique_together contraintNested annotate fields in Django REST Framework serializersHow to specify a query parameter serializer in django-rest-swagger?Nested URL not showing in Django Rest Swagger






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








6















I'm building an API with django-rest-framework and I started using django-rest-swagger for documentation.
I have a nested serializer with some read_only fields, like this:



# this is the nested serializer
class Nested(serializers.Serializer):
normal_field = serializers.CharField(help_text="normal")
readonly_field = serializers.CharField(read_only=True,
help_text="readonly")

# this is the parent one
class Parent(serializers.Serializer):
nested_field = Nested()


In the generated docs, nested serializers in the Parameters part of the page are rendered with field data type and no hint is given about its content, they are just like other fields.



Now you can see the problem there, as I would like to inform the user that there is a readonly field that should not be sent as part of the nested data but I can not see a way of doing so.



The ideal would be having a model description in Data Type column, just like the Response Class section.



Is there any proper way of doing so?










share|improve this question




























    6















    I'm building an API with django-rest-framework and I started using django-rest-swagger for documentation.
    I have a nested serializer with some read_only fields, like this:



    # this is the nested serializer
    class Nested(serializers.Serializer):
    normal_field = serializers.CharField(help_text="normal")
    readonly_field = serializers.CharField(read_only=True,
    help_text="readonly")

    # this is the parent one
    class Parent(serializers.Serializer):
    nested_field = Nested()


    In the generated docs, nested serializers in the Parameters part of the page are rendered with field data type and no hint is given about its content, they are just like other fields.



    Now you can see the problem there, as I would like to inform the user that there is a readonly field that should not be sent as part of the nested data but I can not see a way of doing so.



    The ideal would be having a model description in Data Type column, just like the Response Class section.



    Is there any proper way of doing so?










    share|improve this question
























      6












      6








      6








      I'm building an API with django-rest-framework and I started using django-rest-swagger for documentation.
      I have a nested serializer with some read_only fields, like this:



      # this is the nested serializer
      class Nested(serializers.Serializer):
      normal_field = serializers.CharField(help_text="normal")
      readonly_field = serializers.CharField(read_only=True,
      help_text="readonly")

      # this is the parent one
      class Parent(serializers.Serializer):
      nested_field = Nested()


      In the generated docs, nested serializers in the Parameters part of the page are rendered with field data type and no hint is given about its content, they are just like other fields.



      Now you can see the problem there, as I would like to inform the user that there is a readonly field that should not be sent as part of the nested data but I can not see a way of doing so.



      The ideal would be having a model description in Data Type column, just like the Response Class section.



      Is there any proper way of doing so?










      share|improve this question














      I'm building an API with django-rest-framework and I started using django-rest-swagger for documentation.
      I have a nested serializer with some read_only fields, like this:



      # this is the nested serializer
      class Nested(serializers.Serializer):
      normal_field = serializers.CharField(help_text="normal")
      readonly_field = serializers.CharField(read_only=True,
      help_text="readonly")

      # this is the parent one
      class Parent(serializers.Serializer):
      nested_field = Nested()


      In the generated docs, nested serializers in the Parameters part of the page are rendered with field data type and no hint is given about its content, they are just like other fields.



      Now you can see the problem there, as I would like to inform the user that there is a readonly field that should not be sent as part of the nested data but I can not see a way of doing so.



      The ideal would be having a model description in Data Type column, just like the Response Class section.



      Is there any proper way of doing so?







      python django django-rest-framework documentation-generation






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 27 '15 at 16:24









      qwattashqwattash

      6405 silver badges12 bronze badges




      6405 silver badges12 bronze badges






















          0






          active

          oldest

          votes










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29901131%2fdjango-rest-swagger-nested-serializers-with-readonly-fields-not-rendered-properl%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes




          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.







          Is this question similar to what you get asked at work? Learn more about asking and sharing private information with your coworkers using Stack Overflow for Teams.



















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid …


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f29901131%2fdjango-rest-swagger-nested-serializers-with-readonly-fields-not-rendered-properl%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to preserve electronics (computers, tablets and phones) for hundreds of years Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) The network's official Twitter account is up and running again. What content…How might modern humans leave a message for 50,000 years?How would an aquatic race develop computers?How do we make computers care for human life?Keeping supplies for 1000 yearsWhat will cell phones become in 100 years?What body armor protects against a laser?Could a society attain 1800s technology if limited to using copper and bronze?Electricity power (magic) and electronicsScavenging metal resources in post-apocalypse after 100 yearsWhy would precursors create devices that can survive and still work after hundreds of years?

          155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해

          Convert JSON to MapSimplest way to convert a string representing JSON array into Java array List of key value pairsHow to take String JSON values into HashMapConvert a JSON String to a HashMapCreating BSON object from JSON stringJSONObject - How to get a value ?Better Map ConstructorReading JSON from Url javaUpdate columns if input values are not null otherwise ignore and keep the existing values of column in databaseHow to store object represented as Json string into Couchbase Lite?Go JSON into MapHow do I efficiently iterate over each entry in a Java Map?Sort a Map<Key, Value> by valuesHow to round a number to n decimal places in JavaCan comments be used in JSON?How do I read / convert an InputStream into a String in Java?How can I pretty-print JSON in a shell script?What is the correct JSON content type?How can I deserialize JSON to a simple Dictionary<string,string> in ASP.NET?Why does Google prepend while(1); to their JSON responses?Parse JSON in JavaScript?