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

OpenAPI Import vnd.api+json support #8489

Open
malandles opened this issue May 16, 2024 · 1 comment
Open

OpenAPI Import vnd.api+json support #8489

malandles opened this issue May 16, 2024 · 1 comment
Labels
add-on bug in:openapi Issues pertaining to OpenAPI Support add-on.

Comments

@malandles
Copy link

malandles commented May 16, 2024

Problem

Using the Open API import, it does not use application/vnd.api+json specified content. The Content-Type and Accept headers are not sent, neither is the body schema. Seems to be an import only issue since I can send the request manually and it works.

Same behavior as #6767

OpenAPI endpoint:

  '/auth':

    post:
      operationId: authenticate
      summary: Authenticate a user
      tags:
        - Auth
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: object
                  required:
                    - attributes
                  properties:
                    attributes:
                      type: object
                      required:
                        - email
                        - password
                      properties:
                        email:
                          type: string
                          example: user@email.test
                        password:
                          type: string
                          example: password

ZAP Request:

POST https://[redacted]/auth HTTP/1.1
host: [redacted]
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:125.0) Gecko/20100101 Firefox/125.0
pragma: no-cache
cache-control: no-cache
accept: */*
content-length: 0

Specifications

@thc202 thc202 added add-on in:openapi Issues pertaining to OpenAPI Support add-on. bug labels May 16, 2024
@kingthorin kingthorin changed the title Open API Import JSON:API support Open API Import vnd.api+json support May 16, 2024
@thc202 thc202 changed the title Open API Import vnd.api+json support OpenAPI Import vnd.api+json support May 30, 2024
@thc202
Copy link
Member

thc202 commented May 30, 2024

Some more details are needed, I'm not able to reproduce the issue with the endpoint provided. Using the definition:

---
openapi: 3.0.0
servers:
  - url: http://localhost/
info:
  description: ''
  version: 1.0.0
  title: ''
paths:
  "/auth":
    post:
      operationId: authenticate
      summary: Authenticate a user
      tags:
        - Auth
      requestBody:
        required: true
        content:
          application/vnd.api+json:
            schema:
              type: object
              required:
                - data
              properties:
                data:
                  type: object
                  required:
                    - attributes
                  properties:
                    attributes:
                      type: object
                      required:
                        - email
                        - password
                      properties:
                        email:
                          type: string
                          example: user@email.test
                        password:
                          type: string
                          example: password
      responses:
        '401':
          description: ''

I get:

POST http://localhost/auth HTTP/1.1
host: localhost
user-agent: Mozilla/5.0 (Windows NT 10.0; rv:125.0) Gecko/20100101 Firefox/125.0
pragma: no-cache
cache-control: no-cache
accept: */*
content-type: application/vnd.api+json
content-length: 73

{"data":{"attributes":{"email":"user@email.test","password":"password"}}}

With version 41.0.0 of OpenAPI Support add-on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-on bug in:openapi Issues pertaining to OpenAPI Support add-on.
Development

No branches or pull requests

2 participants