Ask a Question

The interactive forms are disabled, as no `host` property was found in the specification

SOLVED
sandesh007
Occasional Contributor

The interactive forms are disabled, as no `host` property was found in the specification

When importing API I am getting error as "The interactive forms are disabled, as no `host` property was found in the specification. Please see: OAI 2.0/#swagger-object" And I dont know where to add host config in yaml file.

10 REPLIES 10
ponelat
Staff

Hi!

 

Thanks for reaching out.

Short answer? Its a root level property.  

Longer answer...

The host property is meant to identify the host of the API, without the schema or any URIs.

 

 

Something like...

 

 

swagger: '2.0'  # I'm a swagger document
host: petstore.swagger.io  # The host of the API
schemes:
  - http  # Only served over HTTP, not HTTPS
basePath: /v2  # Optional basePath, that all paths fall under
paths:
  # ... your paths / endpoints

Here is a functional example, to better illustrate ...

 

https://swaggerhub.com/api/ponelat/findByStatus/1

 

Happy coding!

Feel free to bug us, if something isn't working. 

 

Josh

sandesh007
Occasional Contributor

@ponelat I have another issue now ...I imported my api definition and also went on to add integration with amazon API gateway but when I go to aws console, I can't see my API there?

What am I missing?

sandesh007
Occasional Contributor

Also see If I have correctly implemented host property at https://swaggerhub.com/api/sandy007/ffnodeapi/1.0.0

 

I'm afraid I don't know much about the Plugins... but someone who does will be on later. I'll leave that to them.

sandesh007
Occasional Contributor

alrighty..... Thanks a lot Josh.

Regarding your spec...

Host is correct... but you do have two 'basePath' properties. YAML is like JSON, in that it doesn't know what to do with two 🙂

I'm guessing the `basePath: /api` is the correct one, not the `basePath: /v1` on line 37?

You're welcome 🙂

sandesh007
Occasional Contributor

@ponelat should I be giving my public ip as host value? when I do that I get error as

connect ECONNREFUSED 27.106.109.11:443

Yeah the public IP should work fine.

Can you 'curl' your server? 

cancel
Showing results for 
Search instead for 
Did you mean: