Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example with a simple microservice #1

Open
alejogutierrez opened this issue Feb 2, 2017 · 23 comments
Open

Example with a simple microservice #1

alejogutierrez opened this issue Feb 2, 2017 · 23 comments

Comments

@alejogutierrez
Copy link

Hi I was looking to the implementation but still don't know how to interact with a service.
It is possible to see an example with a simple service?
Also a license would be awesome, thanks

@dusterio
Copy link
Contributor

dusterio commented Feb 2, 2017

I've just added a license - thanks for noticing this! :)

Sure, we can provide an example. Does your simple microservice have Swagger documentation?

@alejogutierrez
Copy link
Author

Well not really, in fact I found your repo because right now I'm moving from a monolitic Laravel app to microsevices written in Lumen.
So does it mean that you have to use an specific modeling lang like swagger o RAML?
Thanks again

@dusterio
Copy link
Contributor

dusterio commented Feb 2, 2017

You can either do it manually by providing your API gateway routes in GATEWAY_ROUTES environment variable, or you could parse Swagger JSON automatically. Swagger is just a nice way

@alejogutierrez
Copy link
Author

Fine I'm going to take a look using swagger.

@reindeer77
Copy link

I agree that it would be awesome to have some configuration examples (in my case swagger based microservice, but any further hint would be really appreciated) Thanks!.

@dusterio
Copy link
Contributor

dusterio commented Feb 8, 2017

Sure, you are right. Will add some examples tomorrow!

@moon0326
Copy link

moon0326 commented Jun 9, 2017

@dusterio Hi Dusterio, where you able to add examples? The doc really does not make sense. I'm pretty sure that no one can run the full example, especially Swagger parts. It would be nice to have working examples with Swagger support.

@dusterio
Copy link
Contributor

dusterio commented Jun 9, 2017

@moon0326 I did but perhaps it wasn't enough :) I will review the documentation today and make sure it's comprehensive!

@moon0326
Copy link

moon0326 commented Jun 9, 2017

@dusterio Thank you so much!

@spacecomx
Copy link

@moon0326 Have you managed to use swagger with the api gateway. I don't get how this works. Any help will be appreciated. What does the routes.json file do?

@dusterio
Copy link
Contributor

@spacecomx your microservices are expected to expose Swagger documentation endpoints (version 1), all actions will be imported upon start. routes.json is an internal, auto-generated file - a result of parsing of those Swagger endpoints.

@spacecomx
Copy link

@dusterio Thats where I'm hitting a stone wall. The gateway set config file provided with the package endpoint are local? I get an error no "apis" with petstore for example? It that related to swagger version. I did drop you an email yesterday, please can you check it out. Thanks :)

@dusterio
Copy link
Contributor

@spacecomx I've just checked and Petstore is only provided in Swagger v2, it didn't exist till v2 I suppose. I guess it's time to add Swagger v2 support to Vrata.

The reason I stuck with v1 only originally is - all major frameworks I checked at that time (~6 months ago) only had packages for v1.

@spacecomx
Copy link

@dusterio Oh you a Star. When creating apis with swagger it defaults to v2.0. Trying to change it to v1 runs an error in the UI. I saw you mentioned v1.0 in your docs, but did not expect that to be an issue at the time. Any time frame on the support for v2? Thanks for the quick responses, wow!

@dusterio
Copy link
Contributor

@spacecomx I'll check tomorrow! if it's something simple (the difference is not too big) - I will add a v2 parser tomorrow :)

@spacecomx
Copy link

Thank your attention and addressing enquiries so quickly. Please can you include an example the petstore setup in the gateway config or docs. Most will look at swagger docs and reference the petstore api to understand the workflow. Look forward to the update to v2.

@spacecomx
Copy link

@dusterio Just a side note. Swagger 3.0 is planned to be released by the end of July. The name will be changing to OpenAPI, but the tooling will continue to have the Swagger name.

@spacecomx
Copy link

@dusterio Do you have any feedback on the swagger v2.0 requirements. I was hoping to get the gateway up an running the weekend. If not ready, is there anyway to manually set the api endpoints without swagger so I can get up an running. I have two services that must be pushed into the gateway. Please help, thank you.

@rizwanmcs
Copy link

where we will define routes mapping in this project?

@harunnryd
Copy link

@dusterio Hi, where you able to add examples? :(

@agungsugiarto
Copy link

no example with swagger :(

@eddycastillon
Copy link

Thank you so much for this awesome gateway.  I am trying to use this one however I have a couple questions about swagger. Until I know there are two ways to generate documentation for an API using swagger.

1 - Using the public swagger editor: https://swagger.io/. It  generates API documentation and lets you share and collaborate  with people. I am able to export my documentation but I do not know how to use  the exported  documentation ( swagger.json ) to discover it. through the gateway.  I think I need to create a controller, route ,etc.

2 - Using some composer packages that generates that documentation. To generate the documentation , basically you need to use the swagger notation in each controller and function. The package exposes your documentation so the gateway can discover the service.

Based on your experience, what is the best approach to document an API.  If you use some composer package for lumen,  Could you share the name please.

Thank you

@harunnryd
Copy link

harunnryd commented Aug 18, 2020

@eddycastillon you can use my api gateway bro :) https://github.com/harunnryd/gateid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants