regulaforensics / DocumentReader-web-openapi

OpenAPI definitions of Regula Document Reader web application
https://dev.regulaforensics.com/DocumentReader-web-openapi
Other
8 stars 10 forks source link
barcode-reader document-reader document-recognition idcard mrz mrz-codes ocr openapi-definitions passport regula regulaforensics yml

Regula Document Reader OpenAPI definitions

documentation release

Main GitHub repository

Clients

Structure

Updating clients according to the current spec

To update clients, use update clients GitHub action. Specify title PR and press run. For each client PR with changes will be created.

:warning: NOTE: Static typed clients, such as Java or C#, require adding all new enums to update-models.sh ENUM_MAPPINGS section.

:warning: NOTE: For some clients generator produces not-valid client code. See update-models.sh for ad-hocks fixing generator issues.

:warning: NOTE: Do not edit generated code. Create wrappers, decorators, etc in ext folder.

:bulb: All clients have RawResultItem container that is used for deserialization for undescribed types. This container is a simple map/dict.

Spec validation

docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli validate --recommend -i /local/index.yml 

Building Redoc single page html documentation

Edit rt.yml - remove components.schemas.ResultItem.discriminator node

Edit rt-authenticity.yml - remove components.schemas.AuthenticityCheckResultItem.discriminator

Then run next command:

npx redoc-cli bundle "$PWD/index.yml" --output document-reader-static-doc.html \
--options.maxDisplayedEnumValues=5 --options.theme.logo.gutter="20px" \
--options.theme.colors.primary.main="#8a53cb" --options.expandResponses="all" \
--options.expandSingleSchemaField --options.hideDownloadButton --options.jsonSampleExpandLevel="6"

Bundle scheme to single .json file

npx openapi-generator-cli generate -i index.yml  -g openapi  --skip-validate-spec