TOMP-WG / TOMP-API

Transport Operator to Mobility-as-a-Service Provider-API development for Mobility as a Service
Apache License 2.0
100 stars 41 forks source link

[BUG] enum AccessMethods contains dashes where other enums contain underscores #470

Open vmastenb opened 2 years ago

vmastenb commented 2 years ago

API Version

1.3.0

Summary

enum AccessMethods (used in object AssetProperties) contains dashes (e.g. TOMP-API or AXA-EKEY-OTP) where other enums use underscores

Expected Behavior

I would expect the same way of defining enums in the whole project

I am implementing this api in .NET, and in .Net no dashes are allowed in enums. Please change to underscore or CamelCase.

edwinvandenbelt commented 2 years ago

Hello Vincent, when I generate the .net server using the swagger editor, I do get this file: /*

namespace IO.Swagger.Models { ///

/// Gets or Sets assetAccessMethods /// [JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] public enum AssetAccessMethods { /// /// Enum DEEPLINKEnum for DEEPLINK /// [EnumMember(Value = "DEEPLINK")] DEEPLINKEnum = 0, /// /// Enum QREnum for QR /// [EnumMember(Value = "QR")] QREnum = 1, /// /// Enum AZTECEnum for AZTEC /// [EnumMember(Value = "AZTEC")] AZTECEnum = 2, /// /// Enum TOMPAPIEnum for TOMP-API /// [EnumMember(Value = "TOMP-API")] TOMPAPIEnum = 3, /// /// Enum AXAEKEYOTPEnum for AXA-EKEY-OTP /// [EnumMember(Value = "AXA-EKEY-OTP")] AXAEKEYOTPEnum = 4, /// /// Enum PHYSICALKEYEnum for PHYSICAL-KEY /// [EnumMember(Value = "PHYSICAL-KEY")] PHYSICALKEYEnum = 5, /// /// Enum BARCODEEnum for BARCODE /// [EnumMember(Value = "BARCODE")] BARCODEEnum = 6, /// /// Enum PDFEnum for PDF /// [EnumMember(Value = "PDF")] PDFEnum = 7, /// /// Enum HTMLEnum for HTML /// [EnumMember(Value = "HTML")] HTMLEnum = 8, /// /// Enum OVCEnum for OVC /// [EnumMember(Value = "OVC")] OVCEnum = 9, /// /// Enum EMVEnum for EMV /// [EnumMember(Value = "EMV")] EMVEnum = 10, /// /// Enum NONEEnum for NONE /// [EnumMember(Value = "NONE")] NONEEnum = 11 } }

The generated C# code seems to compile correctly. The EnumMember-annotations are coping with the dash-problem. Does this work for you as well?

vmastenb commented 2 years ago

Yes, that works for me as well. So for implementation it is no issue anymore, still it is different than other enums where underscores are used instead of -dashes-

edwinvandenbelt commented 2 years ago

Registered for version 2.0, since it's officially a breaking issue

edwinvandenbelt commented 9 months ago

MUST

edwinvandenbelt commented 8 months ago

https://github.com/TOMP-WG/TOMP-API/commit/7b4960e55396aae8566c831fcf853dc1dfbcf6df