Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swagger / NSwag support #107

Open
jochenjonc opened this issue Aug 10, 2018 · 2 comments
Open

Swagger / NSwag support #107

jochenjonc opened this issue Aug 10, 2018 · 2 comments

Comments

@jochenjonc
Copy link

Hi,

Has anyone used the GeoJSON.Net library in combination with NSwag?

I've tried and the problems I have are for instance the lack of parameterless constructor on the geometry types. Or maybe if the types would all have an interface it would work also.

Regards,

Jochen

@matt-lethargic
Copy link
Member

No, I'll try and give it a go and see where any problems are.

@dave-yotta
Copy link

dave-yotta commented Jan 3, 2024

The problem is that IGeometryObject is not compatible with geojson:

Point.Coordinates is an IPosition[] with lat,long and alt properties, not a float[]. This leads to incorrect jsonschema being generated.

Edit: My mistake - there are JsonConverters on the IPosition properties although nswag doesn't use that to transform the schema. That's easy to "fix" with a typemapper. IGeometryObject or IGeoJSONObject doesn't have a JsonInheritanceConverter which is more difficult to work around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants