jaystack / odata-v4-server

With JayStack OData v4 Server you can build your own data endpoints without the hassle of implementing any protocol-level code. This framework binds OData v4 requests to your annotated controller functions, and compiles OData v4 compatible response. Clients can access services through OData-compliant HTTP requests. We recommend the JayData library for consuming OData v4 APIs.
https://jaystack.com/products/jaystack-odata-v4-server/
76 stars 55 forks source link

Support for other property attributes? #21

Closed awright415 closed 6 years ago

awright415 commented 6 years ago

I've been looking for a way to add attributes like maxLength, precision, and scale using decorators. So far, I haven't had any luck. Is there a way to do this with model classes directly, or does it require lower level solutions like a schema.json file or using odata-v4-metadata?

lazarv commented 6 years ago

This is now implemented in commit https://github.com/jaystack/odata-v4-server/commit/d697ad39f04483ab7c4a6db2059c1f322afe4416. Update to latest odata-v4-server version.

Use @Edm decorators to annotate the entity class. This will only affect the metadata document. No automatic business logic happens when using these decorators.