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

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

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