Logic API
Introspection
Get a machine-readable OpenAPI description of a published API, and check which API version a host is serving.
App developers shouldn’t have to guess an API’s addresses, inputs and response shapes. Each published Logic API version can be described as an OpenAPI schema, the standard JSON format that code generators, API gateways and testing tools understand. Because the schema is generated from the published version, it always matches what that version offers.
Get the OpenAPI schema
Section titled “Get the OpenAPI schema”Generate the schema of a published version and hand the file to developers, or produce it in a pipeline:
flowon-dynamics generate-openapi \ --connectionstring "$DATAVERSE_CONNECTION" \ --project-name "Contoso Service" \ --api "Customer Portal API" \ --version 2.1 \ --output-directory ./schemasThe schema is written as <API name>.json (here schemas/Customer Portal API.json). Leave out --version to describe the latest published version. See generate-openapi.
$schema = Test-GenerateOpenApiSchemaCmdletCommand ` -ConnectionString $env:DATAVERSE_CONNECTION ` -ProjectName "Contoso Service" -ApiName "Customer Portal API" -ApiVersion 2.1 ` -OutputDirectory .\schemasThe cmdlet returns the path of the schema file. See PowerShell module.
Your hosting team can also publish the schema, and an interactive documentation page, on the API host itself. Ask them for the address.
What the schema contains
Section titled “What the schema contains”- every endpoint of the version, with its address and HTTP method;
- the inputs of each endpoint, with their types;
- the shapes of the responses.
What developers use it for
Section titled “What developers use it for”| Use | How |
|---|---|
| Typed client code | Generate a client for TypeScript, C#, Java, Swift or Kotlin with a standard OpenAPI generator, instead of writing HTTP calls by hand. |
| Trying out endpoints | Import the schema into an API testing tool such as Postman. |
| API gateways | Import it into your API management product to publish, throttle or monitor the API. |
| Form building and validation | Read input types and limits from the schema to build forms and validate entries before sending them. |
Generate the schema again whenever you publish a new version, and keep it with the app’s source code so client changes are reviewed with it.
Check what a host serves
Section titled “Check what a host serves”The API host also answers GET /health with a short report of the project, API and version it has loaded and whether it is healthy. Use it to confirm, after a deployment, that the host serves the version you expect.