-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
Description
Using the csharp generator with an array of objects produce code that cannot be compiled.
I have provided a minimal file to reproduce the problem and an example of the generated code that doesn't compile.
I have also provided the manual fix I need to do everytime I generate code
basically, it's just a minor fix to change:
List<Dictionary>
to
List<Dictionary<string, object>>
OpenAPI declaration file content or url
openapi: 3.0.3
info:
title: Test
version: 1.0.0.0
servers:
-
url: 'https://www.example.com'
paths:
/test:
get:
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/notificationtest-getElements-v1-Response-mPayload'
description: Successful response
operationId: Test
summary: Retrieve an existing Notificationtest's Elements
components:
schemas:
Custom-Variableobject-Response:
description: A Variable object without predefined property names
type: object
additionalProperties: true
Field-pkiNotificationtestID:
type: integer
notificationtest-getElements-v1-Response-mPayload:
required:
- pkiNotificationtestID
- a_objVariableobject
type: object
properties:
pkiNotificationtestID:
$ref: '#/components/schemas/Field-pkiNotificationtestID'
a_objVariableobject:
type: array
items:
$ref: '#/components/schemas/Custom-Variableobject-Response'Steps to reproduce
Suggest a fix
The generated code is like this:
public NotificationtestGetElementsV1ResponseMPayload(int pkiNotificationtestID = default(int), List<Dictionary> aObjVariableobject = default(List<Dictionary>))It should be like this:
public NotificationtestGetElementsV1ResponseMPayload(int pkiNotificationtestID = default(int), List<Dictionary<string, object>> aObjVariableobject = default(List<Dictionary<string, object>>))Thanks in advance
Reactions are currently unavailable