API Enablement

Restriction about $REF into a path in a Swagger document

  • 1.  Restriction about $REF into a path in a Swagger document

    Posted Thu November 04, 2021 10:34 AM

    Hi guys, I hope you are well.
    Regarding the toolkit restriction saying "$ref not supported in a path".
    I have this swagger and want to see if that restriction applies. In the PATH /inq I have a $ref and the toolkit built the artifacts OK but when the API is executed I get UNDEFINED_ELEMENT error. I tested the same api  without $ref and worked ok.

    Please let me know any comment.
    Regards
    Carlos

    {

     "swagger": "2.0",

     "info": {

       "description": "This documentation describes the REST API for the afins POC",

       "version": "1.0",

       "title": "Afins POC - API Documentation"

     },

     "host": "int.latam.api.fiservapps.com",

     "basePath": "/latam-gfs-debitcard/afinz",

     "tags": [

       {

         "name": "DebitAuth",

         "description": "Provides mock responses for afins POC"

       }

     ],

     "schemes": [

       "https"

     ],

     "paths": {

       "/inq": {

         "get": {

           "tags": [

             "DebitAuth"

           ],

           "summary": "Returns mock response for Debith Auth",

           "operationId": "DebitAuth",

           "produces": [

             "application/json"

           ],

           "responses": {

             "200": {

               "description": "OK",

               "schema": {

                 "$ref": "#/definitions/debitAuthOperationResponse"

               }

             }

           },

           "deprecated": false

         }

       }

     },

     "definitions": {

       "debitAuthOperationResponse": {

         "type": "object",

         "properties": {

           "debitAuthorizationResponse": {

             "type": "object",

             "properties": {

               "referenceAbsoluteTime": {

                 "type": "integer",

                 "format": "int32"

               },

               "internalReferenceNumber": {

                 "type": "integer",

                 "format": "int32"

               },

               "authorizationDecision": {

                 "type": "string"

               },

               "declineReason": {

                 "type": "string"

               },

               "availableToSpendAmount": {

                 "type": "integer",

                 "format": "int32"

               }

             }

           }

         }

       }

     }

    }



    ------------------------------
    carlos donatucci
    ------------------------------