AEM 6.3 - Swagger Rest Call Returning 404 | Community
Skip to main content
Level 2
December 13, 2018

AEM 6.3 - Swagger Rest Call Returning 404

  • December 13, 2018
  • 1 reply
  • 10845 views

I've made a simple Rest API with a couple GET calls. one returns a string and one returns a json object.

The rest service works when called externally and returns the string and object.

However when trying to call or test the methods, after successfully hooking it to a data form model, aem gives a 404.

12.12.2018 15:40:44.075 *ERROR* [0:0:0:0:0:0:0:1 [1544665244058] POST /content/dam/formsanddocuments-fdm/test-swagger.executeDermisQuery.json HTTP/1.1] com.adobe.aem.dermis.core.servlet.DermisBridgeServlet Exception while executing operation

com.adobe.aem.dermis.exception.DermisException: <html><head><title>Error</title></head><body>404 - Not Found</body></html>

        at com.adobe.aem.dermis.core.rest.service.RestInvoker.invokeOperation(RestInvoker.java:126)

        at com.adobe.aem.dermis.core.rest.service.RestConnector.executeRequest(RestConnector.java:115)

        at com.adobe.aem.dermis.api.AbstractConnector.executeOperation(AbstractConnector.java:435)

swagger.json file used,

{

   "swagger": "2.0",
   "info": {

   "version": "0.0.1-SNAPSHOT",
   "title": "RestTest"
   },
   "host": "localhost:8083",
   "basePath": "/rest",
   "schemes": [

   "http"
   ],
   "paths": {

   "/test": {

   "get": {

   "consumes": [

  ],
   "produces": [

   "text/plain"
   ],
   "parameters": [

  ],
   "responses": {

   "200": {

   "description": "OK",
   "headers": {

  },
   "schema": {

   "type": "string"
   }

  }

  }

  }

  },
   "/test/exception": {

   "get": {

   "consumes": [

  ],
   "produces": [

   "application/json"
   ],
   "parameters": [

  ],
   "responses": {

   "200": {

   "description": "OK",
   "headers": {

  },
   "schema": {

   "$ref": "#/definitions/TestObject"
   }

  },
   "406": {

   "description": "Not Acceptable",
   "headers": {

  },
   "schema": {

   "type": "object"
   }

  }

  }

  }

  },
   "/test/message": {

   "get": {

   "consumes": [

  ],
   "produces": [

   "application/json"
   ],
   "parameters": [

  ],
   "responses": {

   "200": {

   "description": "OK",
   "headers": {

  },
   "schema": {

   "type": "string"
   }

  }

  }

  }

  },
   "/test/object": {

   "get": {

   "consumes": [

  ],
   "produces": [

   "application/json"
   ],
   "parameters": [

  ],
   "responses": {

   "200": {

   "description": "OK",
   "headers": {

  },
   "schema": {

   "$ref": "#/definitions/TestObject"
   }

  }

  }

  }

  }

  },
   "definitions": {

   "TestObject": {

   "properties": {

   "id": {

   "type": "integer"
   },
   "name": {

   "type": "string"
   }

  }

  }

  }

}

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

Mayank_Gandhi
Adobe Employee
Adobe Employee
December 19, 2018

Hi James,

Did you got this working or still need some help with this?

jamestvuAuthor
Level 2
December 19, 2018

Hey Mayank,

I haven't figured it out. I've also tried using the https://petstore.swagger.io/v2/swagger.json

but testing any of the methods in the Test Form Data Model screen gives an error in the input json. Any idea on why this occurs?

May 11, 2020

Hi,

 

I am also facing similar issue. Is there any solution to this issue?