istio.io/istio@v0.0.0-20240520182934-d79c90f27776/samples/bookinfo/swagger.yaml (about)

     1  swagger: "2.0"
     2  info:
     3    description: "This is the API of the Istio BookInfo sample application."
     4    version: "1.0.0"
     5    title: "BookInfo API"
     6    termsOfService: "https://istio.io/"
     7    license:
     8      name: "Apache 2.0"
     9      url: "http://www.apache.org/licenses/LICENSE-2.0.html"
    10  basePath: "/api/v1"
    11  tags:
    12  - name: "product"
    13    description: "Information about a product (in this case a book)"
    14  - name: "review"
    15    description: "Review information for a product"
    16  - name: "rating"
    17    description: "Rating information for a product"
    18  externalDocs:
    19    description: "Learn more about the Istio BookInfo application"
    20    url: "https://istio.io/docs/samples/bookinfo.html"
    21  paths:
    22    /products:
    23      get:
    24        tags:
    25        - "product"
    26        summary: "List all products"
    27        description: "List all products available in the application with a minimum amount of information."
    28        operationId: "getProducts"
    29        consumes:
    30        - "application/json"
    31        produces:
    32        - "application/json"
    33        responses:
    34          200:
    35            description: "successful operation"
    36            schema:
    37              type: "array"
    38              items:
    39                $ref: "#/definitions/Product"
    40    /products/{id}:
    41      get:
    42        tags:
    43        - "product"
    44        summary: "Get individual product"
    45        description: "Get detailed information about an individual product with the given id."
    46        operationId: "getProduct"
    47        consumes:
    48        - "application/json"
    49        produces:
    50        - "application/json"
    51        parameters:
    52        - name: "id"
    53          in: "path"
    54          description: "Product id"
    55          required: true
    56          type: "integer"
    57          format: "int32"
    58        responses:
    59          200:
    60            description: "successful operation"
    61            schema:
    62              $ref: "#/definitions/ProductDetails"
    63          400:
    64            description: "Invalid product id"
    65    /products/{id}/reviews:
    66      get:
    67        tags:
    68        - "review"
    69        summary: "Get reviews for a product"
    70        description: "Get reviews for a product, including review text and possibly ratings information."
    71        operationId: "getProductReviews"
    72        consumes:
    73        - "application/json"
    74        produces:
    75        - "application/json"
    76        parameters:
    77        - name: "id"
    78          in: "path"
    79          description: "Product id"
    80          required: true
    81          type: "integer"
    82          format: "int32"
    83        responses:
    84          200:
    85            description: "successful operation"
    86            schema:
    87              $ref: "#/definitions/ProductReviews"
    88          400:
    89            description: "Invalid product id"
    90    /products/{id}/ratings:
    91      get:
    92        tags:
    93        - "rating"
    94        summary: "Get ratings for a product"
    95        description: "Get ratings for a product, including stars and their color."
    96        operationId: "getProductRatings"
    97        consumes:
    98        - "application/json"
    99        produces:
   100        - "application/json"
   101        parameters:
   102        - name: "id"
   103          in: "path"
   104          description: "Product id"
   105          required: true
   106          type: "integer"
   107          format: "int32"
   108        responses:
   109          200:
   110            description: "successful operation"
   111            schema:
   112              $ref: "#/definitions/ProductRatings"
   113          400:
   114            description: "Invalid product id"
   115  
   116  
   117  definitions:
   118    Product:
   119      type: "object"
   120      description: "Basic information about a product"
   121      properties:
   122        id:
   123          type: "integer"
   124          format: "int32"
   125          description: "Product id"
   126        title:
   127          type: "string"
   128          description: "Title of the book"
   129        descriptionHtml:
   130          type: "string"
   131          description: "Description of the book - may contain HTML tags"
   132      required:
   133      - "id"
   134      - "title"
   135      - "descriptionHtml"
   136    ProductDetails:
   137      type: "object"
   138      description: "Detailed information about a product"
   139      properties:
   140        id:
   141          type: "integer"
   142          format: "int32"
   143          description: "Product id"
   144        publisher:
   145          type: "string"
   146          description: "Publisher of the book"
   147        language:
   148          type: "string"
   149          description: "Language of the book"
   150        author:
   151          type: "string"
   152          description: "Author of the book"
   153        ISBN-10:
   154          type: "string"
   155          description: "ISBN-10 of the book"
   156        ISBN-13:
   157          type: "string"
   158          description: "ISBN-13 of the book"
   159        year:
   160          type: "integer"
   161          format: "int32"
   162          description: "Year the book was first published in"
   163        type:
   164          type: "string"
   165          enum:
   166            - "paperback"
   167            - "hardcover"
   168          description: "Type of the book"
   169        pages:
   170          type: "integer"
   171          format: "int32"
   172          description: "Number of pages of the book"
   173      required:
   174      - "id"
   175      - "publisher"
   176      - "language"
   177      - "author"
   178      - "ISBN-10"
   179      - "ISBN-13"
   180      - "year"
   181      - "type"
   182      - "pages"
   183    ProductReviews:
   184      type: "object"
   185      description: "Object containing reviews for a product"
   186      properties:
   187        id:
   188          type: "integer"
   189          format: "int32"
   190          description: "Product id"
   191        reviews:
   192          type: "array"
   193          description: "List of reviews"
   194          items:
   195            $ref: "#/definitions/Review"
   196      required:
   197      - "id"
   198      - "reviews"
   199    Review:
   200      type: "object"
   201      description: "Review of a product"
   202      properties:
   203        reviewer:
   204          type: "string"
   205          description: "Name of the reviewer"
   206        text:
   207          type: "string"
   208          description: "Review text"
   209        rating:
   210          $ref: "#/definitions/Rating"
   211      required:
   212      - "reviewer"
   213      - "text"
   214    Rating:
   215      type: "object"
   216      description: "Rating of a product"
   217      properties:
   218        stars:
   219          type: "integer"
   220          format: "int32"
   221          minimum: 1
   222          maximum: 5
   223          description: "Number of stars"
   224        color:
   225          type: "string"
   226          enum:
   227            - "red"
   228            - "black"
   229          description: "Color in which stars should be displayed"
   230      required:
   231      - "stars"
   232      - "color"
   233    ProductRatings:
   234      type: "object"
   235      description: "Object containing ratings of a product"
   236      properties:
   237        id:
   238          type: "integer"
   239          format: "int32"
   240          description: "Product id"
   241        ratings:
   242          type: "object"
   243          description: "A hashmap where keys are reviewer names, values are number of stars"
   244          additionalProperties: 
   245            type: "string"
   246      required:
   247      - "id"
   248      - "ratings"