kubeshop / kusk-gateway

Kusk-gateway is an OpenAPI-driven API Gateway for Kubernetes
https://kubeshop.github.io/kusk-gateway/
MIT License
253 stars 21 forks source link

Kusk-manager does not accept x-kusk:disabled:false #925

Open mortada-codes opened 1 year ago

mortada-codes commented 1 year ago

Describe the bug when deploying an api with path or operation set to x-kusk:disabled:false it throws an error “admission webhook \“vapi.kb.io\” denied the request: spec: x-kusk should be a valid set of options: OperationFinalSubOptions: (POST/todos: either Upstream or Redirect must be specified.).”

openapi: 3.0.0
info:
  title: Todo-Backend API
  version: 1.0.0
  description: API for using the GO-powered backend, containing <b>/todos</b> and
    <b>/todos/{id}</b> paths.
  contact:
    email: apiteam@swagger.io
externalDocs:
  description: Find out more about our API
  url: https://raw.githubusercontent.com/kubeshop/kusk-gateway/main/examples/todomvc/kusk-backend-api.yaml
paths:
  "/todos/{id}":
    get:
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  title:
                    type: string
                    description: Description of what to do
                  completed:
                    type: boolean
                  order:
                    type: integer
                    format: int32
                  url:
                    type: string
                required:
                  - title
                  - completed
                  - order
                  - url
        "400":
          description: Client error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
        "500":
          description: Server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
      summary: Shows a single Todo
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
      tags:
        - Todo
    delete:
      responses:
        "400":
          description: Client error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
        "500":
          description: Server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
      summary: Deletes this Todo
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
      tags:
        - Todo
    patch:
      responses:
        "200":
          content:
            application/json:
              schema:
                type: object
                properties:
                  title:
                    type: string
                    description: Description of what to do
                  completed:
                    type: boolean
                  order:
                    type: integer
                    format: int32
                  url:
                    type: string
                required:
                  - title
                  - completed
                  - order
                  - url
        "400":
          description: Client error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
        "500":
          description: Server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
      summary: Modifies this Todo
      parameters:
        - name: id
          in: path
          schema:
            type: integer
          required: true
      requestBody:
        content:
          application/json:
            schema:
              type: object
              additionalProperties: false
              properties:
                title:
                  type: string
                completed:
                  type: boolean
                order:
                  type: integer
                  format: int32
      tags:
        - Todo
  /todos:
    get:
      responses:
        "200":
          description: The full list of todos
          content:
            application/json:
              schema:
                type: array
                items:
                  type: object
                  properties:
                    title:
                      type: string
                      description: Description of what to do
                    completed:
                      type: boolean
                    order:
                      type: integer
                      format: int32
                    url:
                      type: string
                  required:
                    - title
                    - completed
                    - order
                    - url
        "400":
          description: Client error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
        "500":
          description: Server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
      summary: Lists all Todos
      description: The returned Todos are ordered by 'order' and then 'title'
    post:
      responses:
        "201":
          content:
            application/json:
              schema:
                type: object
                properties:
                  title:
                    type: string
                    description: Description of what to do
                  completed:
                    type: boolean
                  order:
                    type: integer
                    format: int32
                  url:
                    type: string
                required:
                  - title
                  - completed
                  - order
                  - url
        "400":
          description: Client error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
        "500":
          description: Server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
      summary: Creates a new, uncompleted Todo
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                title:
                  type: string
                  description: Description of what to do
                order:
                  type: integer
                  format: int32
              required:
                - title
      tags:
        - Todo
      x-kusk:
        disabled: false
    delete:
      responses:
        "400":
          description: Client error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
        "500":
          description: Server error
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/endpoints.Errors"
      summary: Deletes all Todos
      tags:
        - Todo
components:
  schemas:
    endpoints.Errors:
      type: array
      items:
        type: string
x-kusk:
  mocking:
    enabled: true