Skip to content
This repository has been archived by the owner on Jan 31, 2025. It is now read-only.

How can I use JOI validation for my endpoints? #124

Closed
stanislavt opened this issue Mar 22, 2017 · 2 comments
Closed

How can I use JOI validation for my endpoints? #124

stanislavt opened this issue Mar 22, 2017 · 2 comments

Comments

@stanislavt
Copy link

Could you please explain me, how can I use JOI schemas for custom endpoints? It really doesn't clear id documentation.

@tlivings
Copy link
Contributor

Can you provide some additional detail on what you are trying to do? What are "custom endpoints"? Would that be an endpoint not defined in the API shema?

@stanislavt
Copy link
Author

Sure.

I want to create POST /test/

api.yaml has next rows:

/test:
    post:
      summary: Test import
      parameters:
        -
          in: body
          name: body
          schema:
            $ref: '#/definitions/TestBody'
      tags:
        - Test
      responses:
        201:
          schema:
            $ref: '#/definitions/Test'

How can I define body object using joi and include it into swaggerize?

Why do I need it for: I have dependencies in body properties.
E.g.
email should be unique in DB table.
status is depends on date

@stramel stramel closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants