pyeve / eve-sqlalchemy

SQLAlchemy data layer for Eve-powered RESTful APIs
http://eve-sqlalchemy.readthedocs.io
Other
234 stars 70 forks source link

add support for PostgreSQL JSON type #32

Closed goneri closed 9 years ago

goneri commented 9 years ago

With this change, it's now possible to push JSON in a JSON field. For example, in this example, the struct file has the type JSON.

POST http://127.0.0.1:5000/notifications
Content-Type: application/json

[{"environment_id":"ae7d4ed8-41b4-0206-6aad-0074c0f5b6f1","struct":{"type":"gerrit","server":"somewhere","account":"bob","port":29418}}]

Without this change, the validator will fail because it don't know about JSON. It will expect a string instead, which is the default type.

This patch requires the following patch: https://github.com/nicolaiarocci/cerberus/pull/79

amleczko commented 9 years ago

I will wait until new cerberus is released.

goneri commented 9 years ago

Hi @amleczko,

I dropped the dependency on a new cerberus release.

amleczko commented 9 years ago

Can you add a simple test coverage, too? Thanks!