Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import openapi no request-validation info #2973

Open
cortex35 opened this issue Nov 25, 2024 · 0 comments
Open

import openapi no request-validation info #2973

cortex35 opened this issue Nov 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@cortex35
Copy link

Issue description

Hello,

I try to use this exemple :
https://apisix.apache.org/docs/dashboard/2.8/IMPORT_OPENAPI_USER_GUIDE/#configure-a-route-with-parameters-validation

I put this yaml in a file and import it with apisix-dashboard ( Menu Route -> Advanced -> import ).

The result does not add request-validation plugin with info, is this functionnality is deprecated or abandonned ?

Thanks

Expected behavior

Route add contain request-validation plugin
Exemple :


uri: /hello
name: hello
methods:
  - POST
plugins:
  request-validation:
    body_schema:
      properties:
        name:
          type: string
        status:
          type: string
      rejected_msg: customize reject message
      required:
        - status
      type: object

How to Reproduce

Create file with file ( Menu Route -> Advanced -> import ) :

openapi: 3.0.0
info:
  version: "1"
  description: |-
    test desc
  license:
    name: Apache License 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0
  title: |-
    test title
paths:
  /hello:
    post:
      description: |-
        hello world.
      operationId: hello
      x-apisix-upstream:
        type: roundrobin
        nodes:
          - host: "172.16.238.20"
            port: 1980
            weight: 1
      parameters:
        - name: id
          in: header
          description: ID of pet to use
          required: true
          schema:
            type: string
          style: simple

      requestBody:
        content:
          'application/x-www-form-urlencoded':
            schema:
              properties:
                name:
                  description: Update pet's name
                  type: string
                status:
                  description: Updated status of the pet
                  type: string
              required:
                - status
      responses:
        200:
          description: list response
        default:
          description: unexpected error

Import file with apisix-dashboard ( Menu Route -> Advanced -> import ).

Result :

uris:
  - /hello
name: hello2_hello
methods:
  - POST
upstream_id: hello2
status: 0

Screenshots

No response

Environment

  • apisix version (cmd: apisix version): 3.11.0
  • OS (cmd: uname -a): Debian 11
  • etcd version, if have (cmd: run etcd --version): 3.5.0
  • apisix-dashboard version, if have: 3.0.1

Additional context

No response

@cortex35 cortex35 added the bug Something isn't working label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant