cancel
Showing results for 
Search instead for 
Did you mean: 

What is benefit of virtserver.swaggerhub.com - GET ?

Highlighted
Occasional Contributor

What is benefit of virtserver.swaggerhub.com - GET ?

Hello,

I am a first time user of app.swaggerhub.com and I noticed something

Server0 = virtserver.swaggerhub.com.*

Server1 = my own server

 

When I user Server0 to click on GET I get something like this:

[
  {
    "response": {
      "source": "string",
      "path": "string",
      "name": "string",
      "size": 0,
      "sha": "string",
      "html_url": "string"
    }
  }
]

What is the benefit of that GET Service?

 

Server1 (mine) does not return any array bracket characters [  ]

 

Neither does section Schemas indicate any arrays

Tags (2)
3 REPLIES 3
Highlighted
Moderator

Re: What is benefit of virtserver.swaggerhub.com - GET ?

Hi @srgmat,

 

virtserver.swaggerhub.com is SwaggerHub's mock server, it generates static responses based on the information in your API definition. To learn more about how API mocking works, see:

https://app.swaggerhub.com/help/integrations/api-auto-mocking


Helen Kosova
SmartBear Technical Writer
________________________

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Occasional Contributor

Re: What is benefit of virtserver.swaggerhub.com - GET ?

I see. So if the response of the mockup is not the same than of the real service,

then either there is an error in the Specification or in the Implementation.

--> the error is most likely somewhere on my side, correct?

Highlighted
Occasional Contributor

Re: What is benefit of virtserver.swaggerhub.com - GET ?

I mainly use the API mocking server for "API Design First" where I do not have an implementation and I want to use SwaggerHub to design and test and circulate the API definition before passing it to developers (Get consumers to review before you make the wrong thing!)

 

To get the benefits of the mocking server, you want to include examples with each of your properties. That way when the "Try It Out" button is used, you get back what looks like a real API response. Great for testing, use Postman, Curl or even your browser.

 

Examples:

You have an API definition that you want to return a list (Collection) of something. For example lets say Locations:

 

Your endpoint is going to be something like:

getLocations.PNG

 

Then its going to need a schema that returns a list (Collection of resources) in an array

locationsSchema.PNG

When you use the "Try It Out" you should see something like this

tryItOut.PNG

If your seeing an error make sure that the integration is enabled from the top left menu. I have seen that before where you get a 404 from the try it now button.

Click on the name of your API definition, then integrations and make sure that Auto Mocking is enabled

Integrations.PNG

Good luck

New Here?
Join us and watch the welcome video: