apinf / platform

Apinf - Open source API management platform with multi proxy and protocol support
https://apinf.com/
European Union Public License 1.1
74 stars 33 forks source link

Can't add an API using a valid json or yaml file #3230

Closed Nazarah closed 6 years ago

Nazarah commented 6 years ago

Steps to Reproduce:

  1. go to page: https://staging.apinf.io and login
  2. click Add API
  3. Scroll down to Add OpenAPI Specification
  4. select 'File' from dropmenu
  5. click choose file
  6. select a valid json or yaml or yml file
  7. click import

Outcome: Red s-alert appears showing message: [[object object]] API can't be added to the platform http://recordit.co/6M107C1p0z

Expected Behavior: It should be possible to add an API using a valid json or yaml file that contains atleast API name and URL. User should be redirected to API profile.

Environment: Windows 10, Chrome browser (latest), APInf staging site (https://staging.apinf.io) - relase 0.52

marla-singer commented 6 years ago

@Nazarah Provide a Swagger file that you tried to add

Nazarah commented 6 years ago

Tested in nightly APInf and could not reproduce the error. Description within the json or yaml file needs to be under 1000 characters.

@marla-singer sharing the swagger in rocket chat as GitHub won't allow u to upload json/yaml file

preriasusi commented 6 years ago

@Nazarah Is this again because of staging?

anarva commented 6 years ago

I'm close to the root cause: The docker container on staging has faulty DNS settings so that the request to get the json (Swagger) file is pointing to the wrong IP address. Nothing wrong with the app, if I'm correct.

I'm working on fixing the DNS problem.

marla-singer commented 6 years ago

I will test it again after resolving the problem with DNS settings. I've got strong feeling that the error relates (about [object Object] message)

anarva commented 6 years ago

Modified the platform docker image on staging: Removed staging.apinf.io reference on the last line of /etc/hosts file and now the error is fixed.

@marla-singer, please verify and make other checks you see necessary.

marla-singer commented 6 years ago

@Nazarah Please test it again. [object Object] error doesn;t appear

Nazarah commented 6 years ago

@marla-singer Tested in both vamos.apinf.io and staging.apinf.io with release 0.52. In vamos, I can add an API by uploading swagger file. In APInf staging, i still got the problem [[object object]] I cleaned the browser history before testing it. Tested with Windows 10 and chrome.