- Docker
- Docker Compose
- PgAdmin4 - Optional
- Install via Homebrew
This contains the components required to run Schema Genie.
The Schema Genie stack consists of a docker-compose.yml file which specifies a list of docker images to be run as containers.
- Backend Service
- The Backend service is a docker image built from the schema-genie-backend repository.
- This is the main schema-genie service which relies on the other services to perform data processing or persistence.
- XML-to-XSD Service
- The XML-to-XSD service is a docker image built from the schema-genie-xml-to-xsd repository.
- This processes lists of XML data into Xml Schema Definitions for the backend service, which is important for generating Hitman Schemas.
- OpenApi-Lint Service
- The OpenApi-Lint service is a docker image built from the schema-genie-openapi-lint repository.
- This processes an OpenApi document and produces a lint report on how the document can be improved, based on a set of static rules.
- Postgres
- Postgres is a COTS relational database which is used by schema genie to persist application data.
- This image is not built locally and is instead pulled from dockerhub which is the central docker registry for many COTS and open-source docker images.
These images can either be built locally from the individual repositories or pulled down from a docker image registry.
In the docker-compose.yml file, change the 'image:' field's value to the location of the image in the docker registry you are using, or to the name of the image on your local machine.
image: schema-genie-backend
For each of the first three services above, if you are not pulling the docker images from a docker registry you can build them locally with Docker installed.
- Clone the git repository.
- Open a command terminal in the root directory of the repository.
- Run
docker build . -t {image-name} - Ensure the {image-name} value matches the image field in the docker-compose.yml file in schema-genie-stack.
You should then see the image in the list of local docker images when doing a docker images command.
In some circumstances, you may not have the ability to build the images locally, as you may be unable to pull libraries from the internet. You can unpackage the images with docker if you have been provided with the relevant '.tar' files.
- Download the .tar files to your local machine.
- Open a command terminal in the directory your .tar file is saved.
- Run
docker load --input {image.tar} - Ensure the new image (seen when using the command
docker images) matches the image field in the docker-compose.yml file in schema-genie-stack.
Using the docker stack, you have the option of deploying services locally instead of using Docker. For example deploying the backend locally. In the case of the backend, this can be done by simply commenting out the backend service in the docker-compose.yml and following the instructions in the schema-genie-backend repository to run the service locally.
The following instructions allow for the schema genie stack to be launched.
docker compose up
-
Navigate to Schema Genie Swagger UI
-
Create an application using the
POST /api/v1/applicationsendpoint -
Upload HAR files using the
POST /api/v1/applications/{applicationId}/test-dataendpoint.
applicationId can be found in the location header of the response from the
POST /api/v1/applicationsendpoint
-
Generate a schema using the
POST /api/v1/applications/{applicationId}/generate-schemaendpoint -
Export the HITMAN schema using the
POST /api/v1/applications/{applicationId}/schema/{schemaId}/exportendpoint
schemaId can be a specific revision based on the response from the
POST /api/v1/applications/{applicationId}/generate-schemaendpoint or can be the latest by usingopenapi.
Schema Genie will try to parameterise as much as possible by default.
This behaviour can be altered by either supplying ?nounPrecendenceEnabled=true query string in the generate schema endpoint.
Alternatively, you can supply Schema Genie with a list of (partial) paths that you know are not by parameters by using the POST /api/v1/applications/{applicationId}/known-path-values endpoint.