SmartBear / intellij-swaggerhub-release

3 stars 0 forks source link

API endpoint root: path is ignored #12

Closed res13 closed 3 years ago

res13 commented 3 years ago

I tried to configure the plugin to connect to our on-premise swaggerhub server. As stated in the documentation: https://support.smartbear.com/swaggerhub/docs/integrations/intellij.html, the API endpoint root should be: http(s)://YOUR_SERVER/v1. If I use this endpoint url, I get an error in the intellij event log: java.lang.IllegalStateException: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (JSON String, Number, Array, Object or token 'null', 'true' or 'false')at [Source: (byte[])"<!doctype html> Build, Collaborate & Integrate APIs | SwaggerHub <link rel="canonical" href="https://swagger"[truncated 4040 bytes]; line: 1, column: 2]

The plugin seems to get an HTML response from our swaggerhub server which can't be parsed because a JSON response is expected. I then checked where exactly the plugin tries to connect to and it turns out to be: http(s)://YOUR_SERVER/apis/YOUR_ORGANIZATION?page=0&limit=100. So the "/v1" part in the API endpoint root seems to be ignored by the plugin.

Swaggerhub version: 1.27.0-76 Intellij version: IntelliJ IDEA 2021.1 (Ultimate Edition) Intellij Swaggerhub Plugin version: 1.0.1

emmett008 commented 3 years ago

Hi @res13, thanks for your feedback. We have identified the issue and are working on the fix for this.

emmett008 commented 3 years ago

Retested in v1.0.2 and this is now working as expected

res13 commented 3 years ago

Yes, can confirm, thanks for the quick fix 👍