Forum Discussion

jshier's avatar
jshier
Occasional Contributor
7 years ago
Solved

Troubleshooting Mock API Generation Failure

I'm currently building an OpenAPI3 spec and trying to get the mock service to work with it. Unfortunately I'm constantly getting an integration failure from the mock API. All it says is to check the ...
  • HKosova's avatar
    HKosova
    7 years ago

    Thanks for sharing your spec! Please see the notes below.

     

    1) $refs need / after #:

    # wrong
    $ref: '#components/schemas/ModelName'

    # correct
    $ref: '#/components/schemas/ModelName'

     

    2) Some paths have parameters defined directly under the path rather than inside operations. While this is valid syntax, the mock currently cannot handle it. This is a known issue and the devs are working on a fix. For now, please move the parameters inside operations as a workaround.

    /v....../{id}:
    # Don't put the parameters here #parameters: # - $ref: '#/components/parameters/...' get: ...
    # Put them here for now
    parameters:
    ...

     

    Other than that, your spec looks OK.

     

    After you make the changes, either save the spec again or trigger the mock manually from the integrations list.

     

    Let me know if this helps.