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

make generated server support responses #21

Closed
casualjim opened this issue Jun 14, 2015 · 3 comments
Closed

make generated server support responses #21

casualjim opened this issue Jun 14, 2015 · 3 comments

Comments

@casualjim
Copy link
Member

Currently the generated server assumes that responses never define headers.

@casualjim casualjim added the bug label Jun 14, 2015
@casualjim casualjim added this to the Minimal first release milestone Jun 14, 2015
@chakrit
Copy link
Contributor

chakrit commented Jul 15, 2015

Seems the generator also ignored responses when multiple entries are defined?

Example operation:

put:                                                  
  tags: ['tweets']                                    
  operationId: 'putTweet'                             
  summary: 'Send a single tweet.'                     
  parameters:                                         
    - name: 'tweet'                                   
      in: 'body'                                      
      description: 'The tweet to post'                
      required: true                                  
      schema: { '$ref': '#/definitions/Tweet' }       
  responses:                                          
    '201':                                            
      description: 'Tweet has been saved.'            
      schema: { '$ref': '#/definitions/Result' }      
    '400':                                            
      description: 'There are validation error(s).'   
      schema: { '$ref': '#/definitions/Result' }      

This result in the following signature being generated for the operation:

type PutTweetHandlerFunc func(PutTweetParams) error 

So no mention of the Result struct there.

@chakrit
Copy link
Contributor

chakrit commented Jul 15, 2015

Assuming this is because there is no code in go-swagger to differentiate between different response codes yet?

@casualjim
Copy link
Member Author

I have this for the client on the template-refactor branch, but no such thing for the server yet

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

No branches or pull requests

2 participants