0 Replies Latest reply on Apr 20, 2015 11:01 PM by Jboss Beginner

    Api model property not seen in swagger ui

    Jboss Beginner Newbie

      I have class PET and CATEGORY  as follows. PET has category object. However when i run the application  I do not see the fields of Category class in Swagger UI documentation

      I am not using spring and don't want to use spring. I am not sure what am I missing ?

       

       

       

      @ApiModel(value = "A pet is a person's best friend" )

      public class Pet {

        private long id;

        private Category category;

       

      public long getId() {

          return id;

        }

       

       

        @ApiModelProperty(value = "ID", required=true)

        public void setId(long id) {

          this.id = id;

        }

       

       

        public Category getCategory() {

          return category;

        }

       

       

        @ApiModelProperty(value = "CAT", required=true)

        public void setCategory(Category category) {

          this.category = category;

        }

       

      AND CLASS CATEGORY as

       

      @ApiModel(value = "Category")

      public class Category {

        private long id;

        private String name;

       

       

       

       

        @ApiModelProperty(value = "ID", required=true)

        public long getId() {

          return id;

        }

       

       

        public void setId(long id) {

          this.id = id;

        }

       

       

      OUTPUT SWAGGER UI documentation

       

      {

        "id": 0,

        "category": {}

      }