try string in input type

This commit is contained in:
Wolfgang Hottgenroth 2021-11-25 15:44:16 +01:00
parent 39528bc248
commit 7cf092cc9f
Signed by: wn
GPG Key ID: E49AF3B9EF6DD469
3 changed files with 10 additions and 10 deletions

View File

@ -12,6 +12,8 @@ def CsTypeConverter(i):
match (i): match (i):
case 'integer': case 'integer':
r = 'int' r = 'int'
case 'string':
r = 'string'
return r return r
def OpenApiExtractRefType(i): def OpenApiExtractRefType(i):

View File

@ -34,26 +34,23 @@ paths:
# responses: # responses:
# 201: # 201:
# description: Your items has been inserted # description: Your items has been inserted
/pdb/v2/test1/specificSelectName/{nr}: /pdb/v2/test1/specificSelectName/{txt}:
get: get:
tags: [ "Regular" ] tags: [ "Regular" ]
operationId: Regular.test1specificSelectName operationId: Regular.test1specificSelectName
summary: Returns entries from table test1 using a dedicated select statement summary: Returns entries from table test1 using a dedicated select statement
description: description:
STATEMENTBEGIN STATEMENTBEGIN
select txt select nr, txt
from test1 from test1
where nr = @nr where txt = @txt
STATEMENTEND STATEMENTEND
INPUTMAPPINGBEGIN
nr = Nummer
INPUTMAPPINGEND
parameters: parameters:
- name: nr - name: txt
in: path in: path
required: true required: true
schema: schema:
type: integer type: string
responses: responses:
200: 200:
description: Here are your test1 items description: Here are your test1 items
@ -86,3 +83,5 @@ components:
properties: properties:
txt: txt:
type: string type: string
nr:
type: integer

View File

@ -21,7 +21,6 @@ namespace ${env['packagename']}.Implementations
#for $operation in $operations #for $operation in $operations
#if $operation['paramInputTypes'] #if $operation['paramInputTypes']
// $operation['func']
[DataContract] [DataContract]
public class ${operation['func']}InputType public class ${operation['func']}InputType
{ {
@ -30,7 +29,7 @@ namespace ${env['packagename']}.Implementations
[Required] [Required]
#end if #end if
[DataMember(Name="$inputType['name']")] [DataMember(Name="$inputType['name']")]
public int $inputType['csName'] { get; set; } public $inputType['type'] $inputType['csName'] { get; set; }
#end for #end for
} }