UnionInternationalCheminsdeFer / OSDM

Projects related to an open sales & distribution API for public transportation.
https://osdm.io
Apache License 2.0
50 stars 20 forks source link

Gender should be nullable? #573

Closed benys closed 5 days ago

benys commented 1 month ago

Dear OSDM Team,

For most sale request gender is not required from "offer perspective".

In osdm specification gender doesn't have "nullable" enabled.

Is it valid or not?

Kamil

jspetrak commented 1 month ago

Hello, If you refer to AnonymousPassengerSpecification object, the gender property is not required. So you can omit it completely in the request.

benys commented 1 month ago

Hello, Yes, I know, but we have a problem with C# language.

Swagger generator generate this "ENUM" as NOT NULLABLE, so if we create object by default constructor, always put "MALE" enum value as default. I see that sometimes in swagger specification you decorate by "nullable" for some attributes.

I changed generated code and set this property as nullable.

So if you thinks that is no problem / you can close this ticket :-)

jspetrak commented 1 month ago

I can imagine the issue - I personally use Java (Spring) generator and there, the generator developers found out late that they interpret required and nullable incorrectly.

We will have to revise the whole spec if we use required and nullable property at each attribute in the next versions (we are now about to release 3.3.0 so this can be accommodated.)

I would use X as default if a gender is not known and must be filled in. That is value we introduced for Sweden for diverse sleeping compartments.

schlpbch commented 1 month ago

Do you have other attributes where this issue plagues you?

It would be best, if you could join our weekly discussion on Friday 09:00 to 11:00 so that we can support you best,