Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

142
Views
Why Swagger javascript ref does work in Schemas

I have tow schemas in my aplication, and thats like json inside another json, so i try that

    /**
     * @swagger
     * components:
     *   schemas:
     *      IlistItens:
     *        type: object
     *        required:
     *          - name
     *          - isChecked
     *          - tagColor
     *        properties:
     *          name:
     *            type: string
     *            description: name of task
     *          isChecked:
     *            type: boolean
     *            description: check to finish task
     *          tagColor:
     *            type: HexColor
     *            description: Color of task
     *        exemple:
     *          name: Finish the Job
     *          isChecked: false
     *          tagColor: #0099ff
     */

And i try to use a ref in my second interface.

    /**
     * @swagger
     * components:
     *   schemas:
     *      ICardList:
     *        type: object
     *        required:
     *          - title
     *          - listItens
     *        properties:
     *          title:
     *            type: string
     *            description: Title of List
     *          listItens:
     *            type:
     *              $ref: '#/components/schemas/IListItens'
     *        exemple:
     *          title: List Title
     *          listItens: {"name": "Task to do", "isChecked": false, "color": "#0099ff"}
     */

but every $ref: '#/components/schemas/IListItens' return message error like Could not resolve reference: #/components/schemas/IListItens and i search for a solution and read most of forum, i cant find solution. What i did wrong?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!