Open spaceplum opened 7 years ago
This is a problem with the ReflectionCache in NJsonSchema. It seems that for some types it cannot lookup a property description for and thus First() fails. I'd like to fix this once and for all, but I need a reproduction for that. I'll add an exception handler in GetPropertyName()
and add the type and property name to the exception so that you can find out which type/property makes problems. Then either you fix your project or create a repro so that it can be fixed... is this ok?
Please retry with the CI artifacts: https://ci.appveyor.com/project/rsuter/nswag-25x6o/build/artifacts
With the latest build you should see the type and property which triggers the exception...
Thanks, I'll try and see if I can fix the problem.
Sorry for the delay. It seems that it's NodaTime and some (all?) of its properties that are problematic:
System.InvalidOperationException: Could not get JSON property name of property 'Midnight' and type 'NodaTime.LocalTime'. ---> System.InvalidOperationException: Sequence contains no matching element
How can we solve this?
NodaTime is natively supported by NJsonSchema - but NodaTime.LocalTime is not yet handled:
We should add this type there - should it be handled like a DateTime?
Not sure, but since you already have NodaTime.LocalDate there I'd say that NodaTime.LocalTime should be handled the same way.
Does this look good for you?
https://github.com/RSuter/NJsonSchema/commit/50b1922ab01b1df4d365c3672dfc5919c0b9a1fc
Seems fine!
Hi! I'm trying to use NSwagStudio (build 893) to generate TypeScript client code for our Web API assembly but get a
System.InvalidOperationException: Sequence contains no matching element
. It seems like it's caused by some of our DTO classes, since if I e.g. remove the usage of one possibly problematic class the Swagger specification and TypeScript code are generated, but I can't pinpoint exactly what's the problem. Any ideas on why this is happening and what to look for? Thanks!