spaceapi-community / spaceapi-rs

Rust types and serialization for the Space API.
https://crates.io/crates/spaceapi
Apache License 2.0
6 stars 9 forks source link

Create custom linter for SpaceAPI types #7

Open dbrgn opened 8 years ago

dbrgn commented 8 years ago

E.g. a contact object must contain at least one contact.

http://spaceapi.net/documentation

dbrgn commented 8 years ago

This ticket is still from back when we had a single codebase.

Now that this is a separate crate, it's probably very difficult to implement. Or do you know of a possibility to do this in crates that just use the spaceapi crate?

rnestler commented 8 years ago

We could do it with macros, so that you have to use the macros to create objects.

dbrgn commented 8 years ago

Ah, that's an interesting approach :) Or to allow both models: Create a spaceapi_validate!() macro that you can put around the constructor.