This repository contains OpenAPI specifications for the Voucherify API and all resources necessary for generating SDKs and documentation. It uses Git submodules to manage generated SDKs and includes scripts for processing OpenAPI specifications.
Git submodules for the published SDKs. Each SDK lives in its own repository. See .gitmodules for the remotes. A commit in this repository only stores the submodule SHA.
Do not edit files under sdks/ as part of an OpenAPI or docs change. Publish an SDK with npm run generate-sdk-<lang>. npm run generate-sdks runs every language.
Available SDKs:
- Ruby -
sdks/ruby→ voucherify-ruby-sdk - Java -
sdks/java→ voucherify-java-sdk - Python -
sdks/python→ voucherify-python-sdk - PHP -
sdks/php→ voucherify-php-sdk - .NET -
sdks/dotnet→ voucherify-dotNET-sdk - JavaScript -
sdks/js→ voucherify-js-sdk
OpenAPI.json- Source OpenAPI specification (pathsandwebhooks). Edit this file.readonly-sdks/- Generated SDK input, oneOpenAPI.jsonper language. Written bynpm run prepare-generated.split-openapi-by-tags/- Old tag split. The current generator writesdocumentation/openapi.
The Mintlify documentation site. Prose is *.mdx. Generated OpenAPI files in this folder are rewritten by npm run prepare-generated; edit reference/OpenAPI.json instead.
Mintlify builds a preview only for a pull request whose base is the deployment branch (master). A pull request into another branch does not get that preview.
documentation/.mintlify/AGENTS.md is Mintlify's writing guide for MDX components. It is not a map of this repository.
Configuration
docs.json- navigation, theme, and which OpenAPI file each API group uses ("openapi": "/openapi/....json")style.css- site stylesimages/- images referenced by the site
Prose, grouped the same way as the navigation in docs.json:
get-started/- Get startedguides/- developer guidesintegrations/- integrationsdiscover/,prepare/,build/,optimize/,orchestrate/,analyze/,manage/- product guides for those sectionsapi-reference/- API reference pages, including webhook event pageschangelog/- public Voucherify changelogsnippets/- MDX imported by other pagesexamples/- sample files, such as CSV import templates
Event pages point at a webhook file with frontmatter such as openapi: "/openapi-events/events-customer.json webhook EVENTS.CUSTOMER.CREATED".
Generated OpenAPI (OpenAPI 3.1.0; do not edit by hand):
openapi/*.json- built frompaths. Nowebhookskey.loyalties-v2.jsonholds every path under/v2/loyalties.openapi-events/*.json- webhook operations, built fromwebhooks. Event pages reference these files.
Contains the production-ready OpenAPI specification that can be distributed to clients:
readOnly-openAPI.json- Production OpenAPI schema with verified correctness (may not include all endpoints)ENDPOINTS-COVERAGE.md- Documentation showing which endpoints are supported in the production schema vs. deprecated endpoints
Use ENDPOINTS-COVERAGE.md to verify which endpoints are included in the production schema.
Contains custom Mustache templates used by OpenAPI Generator to customize SDK generation for each language:
csharp/- Templates for .NET SDKjava/- Templates for Java SDKjavascript/&typescript/- Templates for JS/TS SDKphp-nextgen/- Templates for PHP SDKpython/- Templates for Python SDKruby-client/- Templates for Ruby SDK
Contains all automation scripts for processing OpenAPI specifications and generating SDKs/documentation. This is organized into several subdirectories:
Scripts specific to Mintlify documentation generation:
build-update-md-tables-from-openapi.ts- Generates Markdown tables from OpenAPI schemassplit-security-params-then-split-openapi-by-tags.ts- Writesdocumentation/openapianddocumentation/openapi-eventsfrom the source specoutput/- Generated Markdown files for various API objects (Voucher, Campaign, Redemption, etc.)utils/- Utility functions:add-ids-to-h2.ts- Adds IDs to H2 headingsmd-tables.ts- Markdown table utilitiessanitize-html-attributes.ts- HTML attribute sanitizationschema-to-md-table.ts- Converts schemas to Markdown tables
Post-processing applied when an SDK is published:
dotnet/-fix-dotnet-imports.ts,fix-enums-in-dotnet.jsjs/-clean-js-sdk-files.sh,fix-JS-sdk-required-properties-types.js,fix-JS-sdk-types.jsruby/-update-ruby-dockerfile-sdk-version.tsshared/-copy-env-to-sdks.sh
Core scripts used across both SDK and documentation generation:
build-production-openapi.ts- Builds the production OpenAPI filecount-important-statistics-about-openapi.ts- Generates statisticsgenerate-endpoints-coverage-doc.ts- Creates the ENDPOINTS-COVERAGE.md filefix-schemas-with-refs.ts- Resolves schema referencesremove-not-yet-refactored-paths.ts- Filters out incomplete endpointsprepare-open-api/- OpenAPI preparation pipeline:add-missing-defaults.ts- Adds default valuesget-paths-without-deprecated.ts- Filters deprecated pathsmerge-multiple-ok-responses-into-one.ts- Response mergingput-not-object-schemas-into-object-schemas.ts- Schema normalizationremove-breaking-changes/- Language-specific breaking change prevention:dotnet.ts,java.ts,js.ts,php.ts,python.ts,ruby.ts- Per-language filtersutils.ts- Shared utilities
remove-bugged-tags-from-open-api.ts- Tag cleanupremove-not-used-schemas.ts- Unused schema removalremove-required-from-request-and-responses.ts- Required field handlingremove-unwanted-properties.ts- Property filteringremoveOneOfs.ts- OneOf schema resolutionsearchAndReplaceInFiles.ts- Bulk file modifications
TypeScript type definitions:
globals.t.ts- Global type definitions
- Git with submodules support
- Node.js and npm/yarn (for running scripts)
- OpenAPI Generator (for SDK generation)
git clone --recurse-submodules https://github.com/voucherifyio/voucherify-openapi-new.gitIf you already cloned without submodules:
git submodule update --init --recursiveRead the Contributing guide for complete information regarding contribution.
When contributing to this repository:
- Change the API in
reference/OpenAPI.json. - Run
npm run prepare-generatedand commit what it rewrites. This refreshes derived OpenAPI files and Markdown tables. It does not regenerate SDK source.npm run pre-commitis the same command. - Publish an SDK only with
npm run generate-sdk-<lang>. That preparesreference/readonly-sdks/<lang>/OpenAPI.json, runs OpenAPI Generator withmustache-templates/, then appliesscripts/sdks/<lang>/. - Documentation changes belong in
documentation/. - Check
production/ENDPOINTS-COVERAGE.mdfor which endpoints are in the production spec.
Mintlify builds a documentation preview only for a pull request whose base is master. A pull request into another branch does not get that preview.
- Source → Edit
reference/OpenAPI.json. - Derived files →
npm run prepare-generatedrefreshes the Mintlify OpenAPI files,reference/readonly-sdks/, Markdown tables, andproduction/readOnly-openAPI.json. It does not regenerate SDK source. - SDK publish →
npm run generate-sdk-<lang>is a separate step. It usesmustache-templates/andscripts/sdks/<lang>/. - Documentation → Mintlify reads
documentation/. - Production →
production/readOnly-openAPI.jsonis the client-facing specification.