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

Response value schema validation #1085

Merged
merged 6 commits into from
May 2, 2024
Merged

Conversation

joelrosario
Copy link
Member

@joelrosario joelrosario commented May 2, 2024

What:

Implemented support for empty value.

openapi: 3.0.3
info:
  title: Person API
  version: 1.0.0
  description: Person API

servers:
  - url: http://localhost:5000

paths:
  /person/{id}:
    get:
      summary: Fetch person details
      parameters:
        - in: path
          required: true
          name: id
          schema:
            type: number
          examples:
            GET_DETAILS:
              value: 10
      responses:
        '200':
          description: Details fetched
          content:
            application/json:
              schema:
                ${"$"}ref: "#/components/schemas/PersonData"
              examples:
                GET_DETAILS:
                  value:
components:
  schemas:
    PersonData:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        address:
          type: string        

If value is empty, value-related validations will be skipped.

Checklist:

@joelrosario joelrosario merged commit bd2da25 into main May 2, 2024
3 checks passed
@joelrosario joelrosario deleted the response_value_schema_validation branch May 2, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant