≡

JSON Schema for AJAX request

JSON Schema for AJAX request

WernfriedWernfried Posts: 40Questions: 10Answers: 0

Hi Allan

I have a question regarding security. One important rule says "Treat all user-supplied data as untrusted." A common way to ensure security is to validate user-supplied data against a JSON Schema. I have not found any JSON Schema for datatable ajax data. I only found Server-side processing: Sent parameters

I would like to contribute to this part. I already created a working (at least for me) JSON Schema, including also parameters for ColumnControl and SearchBuilder extension. It is also extendable to support extra parameters

Of course, I could copy/paste the schema here as text, however I think it would make more sense to create a PR in your github repository.

What do you think? What would be an appropriate place for it?

Best Regards
Wernfried

Replies

  • allanallan Posts: 66,095Questions: 1Answers: 11,018 Site admin

    Hi,

    The data sent to the server, by default, is HTTP parameters, rather than JSON in the request body (although that can easily be done using ajax.submitAs), so a JSON schema isn't something that would be used in the default case.

    However, as noted, JSON can be sent, and a JSON schema can be both useful for validation and for documentation.

    What would be an appropriate place for it?

    That's a good question - probably in the manual. It could possibly go in the server-side library packages, but I think the manual would be an appropriate place for it. Another option would be a new distribution package - JSON schemas aren't something I've worked with for a number of years now, so I'm not familiar with the current distribution standards.

    The manual being the current target, if you just paste what you have in here, I can get it in and onto the site.

    Allan

Sign In or Register to comment.