/Exposing-DB-Table-as-a-JSON-Structure

Exposing a DB Table as a JSON Structure

Primary LanguageGroovyApache License 2.0Apache-2.0

Description

Axway API Gateway propose a “JDBC” Filter that can be used to query the database. However, by default, the filter returns a Java structure (HashMap / Array / Scalar) The following groovy script is used to query the database and return the results as a JSON structure

API Management Version Compatibilty

This artefact was successfully tested for the following versions:

  • 7.4.1
  • 7.5.3

Install

Sample Policy to authenticate a user against a database with hashed and salted password alt text

Usage

Some remarks about the JSON conversion :

  • This is done by a Groovy script (one line)
  • This is a built-in feature of Groovy (so, no code to maintain)

alt text

Bug and Caveats

Nothing identified

Contributing

Please read Contributing.md for details on our code of conduct, and the process for submitting pull requests to us.

Team

alt text Axway Team

License

Apache License 2.0