[Proposal] API Artifact Directory Structure for API Platform #1412
Replies: 3 comments
-
|
Based on today’s (23/03/2026) discussion, the dev portal directory structure has been updated as follows: devportal-d1/
├── manifest.yaml # optional
├── devportal-api.yaml
├── devportal-api-definition.yaml
├── docs/
│ └── README.md
└── content/ # branding?
├── api-icon.png # internally we have hardcoded to use this as the API icon
├── api-content.hbs
└── landingpage.css
Example apiMetadataPath: ./devportal-api.yaml
apiDefinitionPath: ./devportal-api-definition.yaml
docsPath: ./docs
apiContentPath: ./contentExample apiVersion: devportal.api-platform.wso2.com/v1
kind: RestApi # (RestApi | WS | GraphQL | SOAP | WebSubApi)
metadata:
name: pizzashack-api-v1.0 # Used as the API handle internally
spec:
displayName: PizzaShackAPI # Stored internally as apiName
version: 1.0.0
description: This is a simple API for the Pizza Shack
provider: WSO2
referenceID: <uuid-from-cp>
tags:
- pizza
subscriptionPlans:
- gold
- bronze
visibility: PUBLIC
visibleGroups: []
businessInformation:
businessOwner: Jane Roe
businessOwnerEmail: marketing@pizzashack.com
technicalOwner: John Doe
technicalOwnerEmail: architecture@pizzashack.com
endpoints:
sandboxUrl: https://prod.example.com/pizzashack/v1/api/ ## This has to be a variable if the whole API artifact is imported at once
productionUrl: https://sand.example.com/pizzashack/v1/api/This update introduces a clear separation of concerns by using The structure of the API artifact has been updated based on the following points discussed during the meeting:
Example gatewayApiPath: ./api.yaml
apiMetadataPath: ./api-metadata.yaml
apiDefinitionPath: ./api-definition.yaml
docsPath: ./docs
testsPath: ./tests
thumbnail: ./api-icon.jpgExample description: Lorem ipsum dolar sit amet
gatewayType: wso2/api-platform
lifecycleState: PUBLISHED
devportals:
- portalName: devportal-d1
artifactPath: ./devportals/dev_1 # optional. defaults to portalName
status: PUBLISHED
deployments:
- gatewayName: gateway-g1
status: DEPLOYED
## metadata:
## - endpointUrl: "http://api.yourdomain.comNote: moved subscriptionPlans to api.yaml since now it is available in api.yaml |
Beta Was this translation helpful? Give feedback.
-
|
Few points to be discussed: Source of truth for Resources/Paths of an API in the devportalIn the API platform, the source of truth for an API is the Even if an API is created using a definition, that definition is not preserved. Instead, it is converted into the This is acceptable because However, in the devportal, we require the OpenAPI definition to display operations, enable try-out functionality, and support scopes and security scheme related processing.
Publishing to DevPortal via Management PortalWe have two possible approaches: Option 1: Auto-generate OpenAPI definition
Option 2: Store API definition in the platform
|
Beta Was this translation helpful? Give feedback.
-
|
Updated the structure based on the previous discussion. Latest version is available at [1]. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
<Check the next comment for the updated structure>
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.docs/: 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