Forum Discussion

sambmish's avatar
sambmish
Occasional Visitor
6 years ago

Rest application with only one path.

Hi,

 

I am working on a REST application project (go language), which has only a single path to access different services (/alpha). The 'Accept header' actually contains the information to identify and call a specific service.

For example:

 

/alpha

Accept Header: aplha.v1+json

Retruns: Object x

 

/alpha

Accept Header: alpha.v2+json

Returns: Object y

 

I don't know how to use swagger API to document the REST APIs in this case. I tried giving the same path (/alpha) in the annotation section (go-swagger) of two rest functions, but the generated output only contains one api information (the last annotated api in the go file).

 

Is there any workaround to this problem? Kindly help.

No RepliesBe the first to reply