-
-
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 tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
Description
The openapi3 yaml content looks like:
openapi: 3.0.0
info:
title: (title)
version: 0.0.0
tags: []
paths: {}
components:
schemas:
CopyActivity:
type: object
required:
- $schema
- copyActivitytt
properties:
$schema:
type: string
enum:
- ScopeActivity
copyActivitytt:
type: string
allOf:
- $ref: '#/components/schemas/EntityBase'
EntityBase:
type: object
required:
- $schema
properties:
$schema:
type: string
discriminator:
propertyName: $schema
mapping:
ScopeActivity: '#/components/schemas/CopyActivity'
When I try to use this to generate csharp code, the constructor in the generated subclass is incorrect. Like below:

In the red box, the expected value should be default(stringEnum) instead of a string, as it cannot be correctly assigned.
openapi-generator version
7.9.0
Steps to reproduce
openapi3 yaml file -> csharp model classes
Could you please help check and tell me what I might have done wrong? Or is that should be a bug?
Reactions are currently unavailable