Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Display Derived Objects In Swagger Example Values

Display Derived Objects In Swagger Example Values

Scheduled Pinned Locked Moved Web Development
jsontutorialquestioncsharpcom
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Liagapi
    wrote on last edited by
    #1

    Sorry if this is not the correct forum for discussions on Swagger but I don't know which one is appropriate for it. I have a rest web api created in C# which returns a JSON response containing base objects and their derived objects. In Swagger response body I am able to see both the base objects and derived objects after applying the filters as explained in the post How do I include subclasses in Swagger API documentation using Swashbuckle? - Stack Overflow[^] However, I only see the base objects in the Example Values and not their derived objects. So suppose my JSON contains objects called Dog and Cat which inherit from the Animal object, then only the Animal object will show up in the Example Value but not the Dog or Cat object. Please show me how to modify Swagger Example Value to display base objects and their derived objects. Thanks.

    L T V 3 Replies Last reply
    0
    • L Liagapi

      Sorry if this is not the correct forum for discussions on Swagger but I don't know which one is appropriate for it. I have a rest web api created in C# which returns a JSON response containing base objects and their derived objects. In Swagger response body I am able to see both the base objects and derived objects after applying the filters as explained in the post How do I include subclasses in Swagger API documentation using Swashbuckle? - Stack Overflow[^] However, I only see the base objects in the Example Values and not their derived objects. So suppose my JSON contains objects called Dog and Cat which inherit from the Animal object, then only the Animal object will show up in the Example Value but not the Dog or Cat object. Please show me how to modify Swagger Example Value to display base objects and their derived objects. Thanks.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      You could always ask the person who wrote the StackOverflow answer.

      1 Reply Last reply
      0
      • L Liagapi

        Sorry if this is not the correct forum for discussions on Swagger but I don't know which one is appropriate for it. I have a rest web api created in C# which returns a JSON response containing base objects and their derived objects. In Swagger response body I am able to see both the base objects and derived objects after applying the filters as explained in the post How do I include subclasses in Swagger API documentation using Swashbuckle? - Stack Overflow[^] However, I only see the base objects in the Example Values and not their derived objects. So suppose my JSON contains objects called Dog and Cat which inherit from the Animal object, then only the Animal object will show up in the Example Value but not the Dog or Cat object. Please show me how to modify Swagger Example Value to display base objects and their derived objects. Thanks.

        T Offline
        T Offline
        topwareshop
        wrote on last edited by
        #3

        Best Site in Gaming topwareshop is a brand name in gaming world. We have been providing solution in video games and having best service portfolio.

        1 Reply Last reply
        0
        • L Liagapi

          Sorry if this is not the correct forum for discussions on Swagger but I don't know which one is appropriate for it. I have a rest web api created in C# which returns a JSON response containing base objects and their derived objects. In Swagger response body I am able to see both the base objects and derived objects after applying the filters as explained in the post How do I include subclasses in Swagger API documentation using Swashbuckle? - Stack Overflow[^] However, I only see the base objects in the Example Values and not their derived objects. So suppose my JSON contains objects called Dog and Cat which inherit from the Animal object, then only the Animal object will show up in the Example Value but not the Dog or Cat object. Please show me how to modify Swagger Example Value to display base objects and their derived objects. Thanks.

          V Offline
          V Offline
          VenkatReddy RC
          wrote on last edited by
          #4

          Kindly elaborate more on what exactly you want to modify in Swagger

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups