Skip to content

[C#][Nancy] return collections as arrays to response negotiator#4107

Merged
wing328 merged 5 commits intoswagger-api:masterfrom
simo9000:nancyFxWork
Nov 2, 2016
Merged

[C#][Nancy] return collections as arrays to response negotiator#4107
wing328 merged 5 commits intoswagger-api:masterfrom
simo9000:nancyFxWork

Conversation

@simo9000
Copy link
Copy Markdown
Contributor

@simo9000 simo9000 commented Nov 1, 2016

PR checklist

  • Read the contribution guildelines.
  • Ran the shell/batch script under ./bin/ to update Petstore sample so that CIs can verify the change. (For instance, only need to run ./bin/{LANG}-petstore.sh and ./bin/security/{LANG}-petstore.sh if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates)
  • Filed the PR against the correct branch: master for non-breaking changes and 2.3.0 branch for breaking (non-backward compatible) changes.

Description of the PR

(details of the change, additional tests that have been done, reference to the issue for tracking, etc)

Resubmitting changes from #4061 cleaned up and on a separate branch

@simo9000
Copy link
Copy Markdown
Contributor Author

simo9000 commented Nov 1, 2016

@mstefaniuk @jimschubert please submit feedback if you have any as @wing328 indicated in #4061

@wing328 wing328 added this to the v2.2.2 milestone Nov 2, 2016
@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Nov 2, 2016

Description of the PR

Changed nancyfx template to convert collections to arrays prior to returning from the path delegates. This makes no difference when the request is for json or xml, however if the request is for html, the Nancy response negotiator can't look up view names based with generic collections. Converting the collection to an array prior to returning control to nancy work will allow the view to be discovered by "[]".

@mstefaniuk
Copy link
Copy Markdown
Contributor

@simo9000 @wing328 In my opinion it's very good change.
@jakubmalek Any remarks?

@wing328
Copy link
Copy Markdown
Contributor

wing328 commented Nov 2, 2016

@mstefaniuk thanks for the review.

@simo9000 thanks for the PR, which has been merged into master.

@wing328 wing328 merged commit 8fb3398 into swagger-api:master Nov 2, 2016
acramatte added a commit to comerge/swagger-codegen that referenced this pull request Nov 9, 2016
* upstream/master: (42 commits)
  add vendor extension to handle void response in jaxrs-cxf
  better handling of */*
  Select application/json content-type in python generated client, if */* is in the list of content-types
  update mxf4j sample
  [ObjC] Fix deprecated JSONModel API usage (swagger-api#4133)
  [aspnet5] Fix broken template directory for deprecated lang (swagger-api#4142)
  Add constructFromObject to Javascript enum generation. (swagger-api#4120)
  [Obj-c] Generated code documentation fixes (swagger-api#4130)
  Added QAdept to companies list
  added clarification for swagger-api#4138
  Default added sourceFolder to src/main/java
  Update pojo.mustache
  [feign] Use feign-form (swagger-api#4124)
  DART: Removed the 'justIgnoreThisFlag' flag (swagger-api#4116)
  fix[dart]: multi-word class names work properly now
  [ruby] Validate array correctly It never throws error with any values in array. Every element should be validated against the enum.
  remove glassfish dependencies and use MSF4J internal implementation for the simplicity and reduce dependencies
  updated to next development version
  Added isEmtyString check to avoid IndexOutOfBoundException
  Nancy fx work (swagger-api#4107)
  ...
@simo9000 simo9000 deleted the nancyFxWork branch November 18, 2016 16:28
@wing328 wing328 changed the title Nancy fx work [C#][Nancy] return collections as arrays to response negotiator Feb 20, 2017
davidgri pushed a commit to davidgri/swagger-codegen that referenced this pull request May 11, 2017
* Added switch to config to toggle use of yaml base path as module paths

* NancyFX template updated to return collections as array to allow framework to find views by type name for text/html mime type

* Added some more parser fixes for NancyFX

* Refactored collection parsers in Parameters.cs and changed some to return nullable collections to match the parameter mappings in AbstractCSharpCodegen

* re-ran petstore build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants