[Proposal] API Artifact Directory Structure for API Platform #1412
Piumal1999
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Requirement
Main use cases
Directory Structure
Root-Level Files and Directories
config.yaml: Defines the overall structure of the API artifact. It contains paths and directory mappings (OpenAPI, docs, tests, etc.) and includes deployment-specific configurations. It may also include Governance rulesets which can be used in design time.Example:
api.yaml: Contains API metadata, policies, subscription plans, and other configurations. This file may contain attributes that are not part of the APIDeploymentYAML structure [1] . When deploying an API, this file is processed to retain only the data required by the gateway. Gateway-specific configuration properties are then applied, and a new.yamlfile is generated and used for deployment.api-definition.yaml: Contains the OpenAPI specification.docs/: Contains documentation to be displayed in the management portal.tests/: Contains test-related files.devportals/: Directory contains artifacts for different developer portals. Since an API can be deployed to multiple gateways with different attributes, separate dev portal configurations are maintained under this directory.Dev Portals Directory
For each dev portal, we have:
devportal-api.yaml: Contains properties required by the developer portal and the paths to the related files.devportal-api-definition.yaml: Contains the OpenAPI specification. This may differ from the root-levelapi-definition.yaml. This can be in other formats such as.graphqldocs/: Contains documents displayed in the developer portal. Currently only.mdfiles are supported in bijira implementation. All files in this directory will be automatically linked to the API and displayed using their file names.webcontent/: Contains images and.hbscontent (as well as.cssand.mdif needed). Images can be referenced inside.hbstemplates using their file names as keys. For example, if the file name isapi-icon.png, it can be referenced in a template asapiImageMetadata.api-icon.PS: The file name of OpenAPI specification (
devportal-api-definition.yaml) and directory names fordocsandwebcontentcan be overriden through thedevportal-api.yaml.A ZIP file containing the above dev portal content (e.g.,
devportal-d1) can be published to a standalone gateway using curl or a CLI tool.Example
devportal-api.yamlBeta Was this translation helpful? Give feedback.
All reactions