-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed
RicoSuter/NJsonSchema
#1828Description
I have a yaml file (unfortunately is not public, so I cannot post it here). With 14.0.4, some of the generated class names start with a lowercase letter, while they had before uppercase names.
Here is a yaml snippet:
VariableDatenStandalone:
type: "object"
properties:
dienstnehmer:
$ref: "#/definitions/DienstnehmerRef"
variableDaten:
type: "array"
items:
type: "object"
properties:
validFrom:
type: "string"
format: "date"
example: "2019-01-15"
data:
$ref: "#/definitions/VariableDaten"
"definitions/VariableDaten" is defined like this:
VariableDaten:
type: "object"
properties:
validFrom:
type: "string"
format: "date"
example: "2019-01-15"
dnGruppe:
type: "object"
properties:
kz:
type: "string"
example: "ANG"
name:
type: "string"
example: "Angestellter"
lohnsteuer:
type: "object"
properties:
...
The generated code looks like this:
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.4.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class VariableDatenStandalone
{
[Newtonsoft.Json.JsonProperty("dienstnehmer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public DienstnehmerRef Dienstnehmer { get; set; }
[Newtonsoft.Json.JsonProperty("variableDaten", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public System.Collections.Generic.ICollection<variableDaten> VariableDaten { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.4.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class variableDaten
{
[Newtonsoft.Json.JsonProperty("validFrom", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))]
public System.DateTimeOffset? ValidFrom { get; set; }
[Newtonsoft.Json.JsonProperty("data", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public VariableDaten Data { get; set; }
}
[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.0.4.0 (NJsonSchema v11.0.0.0 (Newtonsoft.Json v13.0.0.0))")]
public partial class VariableDaten
{
[Newtonsoft.Json.JsonProperty("validFrom", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
[Newtonsoft.Json.JsonConverter(typeof(DateFormatConverter))]
public System.DateTimeOffset? ValidFrom { get; set; }
[Newtonsoft.Json.JsonProperty("dnGruppe", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public DnGruppe DnGruppe { get; set; }
[Newtonsoft.Json.JsonProperty("lohnsteuer", Required = Newtonsoft.Json.Required.Default, NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore)]
public Lohnsteuer Lohnsteuer { get; set; }
.....
I don't like the situation that a class name exists in a lower and upper case version. With 13.0.20, the class "variableDaten" was named "VariableDaten3" - not much better, but at least it didn't look strange ;-).
This might be a problem with VB.NET I think - here casing does not matter as far as I know.
If you don't consider it relevant enough to look at, please close this issue.
Metadata
Metadata
Assignees
Labels
No labels