Questions tagged [go-restful]

Go-restful is a Go package for developing REST services. This tag is for questions about this package specifically; questions about REST services development in Go should use the rest tag instead.

Go-restful is a package for building REST web services in Go. It includes a configurable router, support for JSON and XML in requests and responses, access to headers and query parameters, customizable error handling, and other features described on the project homepage.

9 questions
1
vote
1 answer

Can I use a swagger tool combine with go-restful for OpenAPI v3?

I want to generate OpenAPI v3 swagger file, but the rest plugin go-restful doesn't support producing OpenAPI v3, only OpenAPI v2 so I can't produce it by itself. How can I to work with go-restful to produce OpenAPI v3? Is this possible?
anurjalal
  • 31
  • 3
1
vote
0 answers

How to add Location Header in response body on go-restful plugin

I cannot add documentation on response header and generate this schema by using go-restful : I want response body on schema to be like this: "responses": { "302": { "description": "Found. Redirected to login page with either request_id or…
1
vote
1 answer

How to decide on picking new micro service or add to existing micro service when new business feature is requested

I like to understand better on Micro services. Is there checklist which help me to decide particular new feature can be build as new micro service or combine with existing micro services available in my application?
1
vote
1 answer

How to get the full host and url in go-restful

I'm writing a REST API in Go using https://github.com/emicklei/go-restful In my JSON output I want to output absolute path to other REST resources, but I don't know how I can obtain all the relevant parts to build the Path, such as transport…
Joakim
  • 11,468
  • 9
  • 44
  • 50
1
vote
1 answer

Displaying PUT body format with go-restful and swagger

I am using go-restful and swagger to generate apidocs which is working great. The problem I am facing is that when I add a body parameter to the documentation I would like to specify the DataType and its format. I can specify the DataType (i.e.…
user2471801
  • 167
  • 5
  • 12
0
votes
1 answer

go-restful extract URL pattern path from request

I am using a the emicklei/go-restful framework to deal with rest API. I wish to access the route path from the request. Meaning that when I configure a dummy route like this: ws := new(restful.WebService) ws.Path("/resources/names") …
Djoby
  • 602
  • 1
  • 6
  • 22
0
votes
1 answer

go-restful-openapi $refs must reference a valid location in the document

I'm using go-restful in combination with go-restful-openapi to generate my swagger doc automatically. However, on testing the tool with the swagger-editor, I get the following error: $refs must reference a valid location in the…
Jen
  • 121
  • 1
  • 1
  • 7
0
votes
1 answer

How to bind a handler in go-restful?

Go-restful is a good and easy to use Go RESTful style framework, but here is something i am wondering about (this is just a piece of code): func main() { service := new(restful.WebService) service.Route( …
fisafoer
  • 273
  • 1
  • 2
  • 6
0
votes
2 answers

go-restful + JWT authentication

I'm trying to plug JWT authentication within a very simple go service written with go-restful. The code is very similar to: package main import ( "github.com/emicklei/go-restful" "log" "net/http" ) type User struct { Id, Name…
ohe
  • 3,461
  • 3
  • 26
  • 50