mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
NancyFX:
- Fixed parsing enum parameters in NancyModule
This commit is contained in:
parent
57aa6d01d2
commit
c653aeec0b
@ -8,14 +8,15 @@ using {{packageName}}.Utils;
|
||||
|
||||
namespace {{packageName}}.Modules
|
||||
{
|
||||
{{#operations}}{{#operation}}{{#allParams}}{{#isEnum}}{{>innerApiEnum}}{{/isEnum}}{{/allParams}}{{/operation}} public sealed class {{classname}}Module : NancyModule
|
||||
{{#operations}}{{#operation}}{{#allParams}}{{#isEnum}} {{>innerApiEnum}}{{/isEnum}}{{/allParams}}
|
||||
{{/operation}} public sealed class {{classname}}Module : NancyModule
|
||||
{
|
||||
public {{classname}}Module({{classname}}Service service)
|
||||
:base("")
|
||||
{ {{#operation}}
|
||||
{{httpMethod}}["{{path}}"] = parameters =>
|
||||
{
|
||||
{{#allParams}}{{#isBodyParam}}var {{paramName}} = this.Bind<{{&dataType}}>();{{/isBodyParam}}{{^isBodyParam}}{{#isEnum}}{{>innerApiEnumName}}{{/isEnum}}{{^isEnum}}var{{/isEnum}} {{paramName}} = Parameters.ValueOf<{{&dataType}}>(parameters, "{{paramName}}");{{#hasMore}}
|
||||
{{#allParams}}{{#isBodyParam}}var {{paramName}} = this.Bind<{{&dataType}}>();{{/isBodyParam}}{{^isBodyParam}}{{#isEnum}}var {{paramName}} = Parameters.ValueOf<{{>innerApiEnumName}}>(parameters, "{{paramName}}");{{/isEnum}}{{^isEnum}}var {{paramName}} = Parameters.ValueOf<{{&dataType}}>(parameters, "{{paramName}}");{{/isEnum}}{{#hasMore}}
|
||||
{{/hasMore}}{{/isBodyParam}}{{/allParams}}{{#allParams}}{{#required}}
|
||||
Preconditions.IsNotNull({{paramName}}, "Required parameter: '{{paramName}}' is missing at '{{operationId}}'");
|
||||
{{/required}}{{/allParams}}
|
||||
|
@ -46,7 +46,7 @@ namespace {{packageName}}.Models
|
||||
|
||||
public bool Equals({{classname}} other)
|
||||
{
|
||||
return this.Equals((object) other);
|
||||
return Equals((object) other);
|
||||
}
|
||||
|
||||
public override int GetHashCode()
|
||||
|
Loading…
Reference in New Issue
Block a user