Add IndexLink schema to handle index link’s metadata field (#1051)
Add IndexLink schema to handle index link’s metadata field
Reduce Schema Drift and have IndexLink inherit from link
Co-authored-by: Copilot Autofix powered by AI 175728472+Copilot@users.noreply.github.com
V3 api root does not have the meta field
Reference to Link object
Co-authored-by: Copilot Autofix powered by AI 175728472+Copilot@users.noreply.github.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Cloud Foundry CAPI OpenAPI Specification - Experimental
This repository contains the OpenAPI 3.0 specification for the Cloud Foundry API (CAPI). It provides a complete, machine-readable definition of the CAPI endpoints, enabling automated client generation, documentation, and testing.
A rendered version can be consumed at https://cloudfoundry.github.io/cf-openapi/
Project Structure
The repository is organized as follows:
apis/cf/: Contains the OpenAPI specification files, versioned by CAPI release.latest/: A symlink to the latest stable version.3.130.0/: An example of a specific version folder.bin/: Houses build and utility scripts for managing the specification.scripts/: Additional scripts for development and maintenance tasks.Getting Started
Prerequisites
Installation
Clone the repository:
Install the dependencies:
Usage
Linting
yarn lintLints the OpenAPI specification files using
redocly lintto ensure they adhere to the defined rules and best practices. This helps maintain consistency and quality in the specification.Building
yarn buildExecutes the
bin/build.jsscript to bundle the modular OpenAPI files fromapis/cf/**/into individual bundledopenapi.yamlfiles in thedist/directory. It usesredoclyto merge the different OpenAPI files into a single file for each version.Previewing
yarn previewFirst, this command runs the build script to ensure the latest specification is bundled. Then, it starts a local HTTP server using
http-serverto serve thedist/directory. This allows you to preview the generated documentation locally in your browser.Creating a new version
yarn create-version 3.131.0Runs the
bin/create-version.jsscript, which is used to create a new versioned directory underapis/cf/. This is useful when a new version of the CAPI is released and you need to update the specification. It copies the currentapis/cf/latest/openapi.yamlto a new versioned directory, and maintains theredocly.yamlfile for the new version. After running this command and rebuilding, the new version will be available in scalar.Compliance Testing
yarn test:complianceRuns a comprehensive compliance test suite against a live Cloud Foundry API. This script uses
wiretapto proxy requests to the API, validating them against the OpenAPI specification in real-time. It clones thecapi-bara-testsrepository and executes its test suite against the proxied API.Prerequisites:
PATH.CF_API_URL: The URL of the Cloud Foundry API.CF_APPS_DOMAIN: The application domain for your Cloud Foundry instance.CF_ADMIN_USER: The username for an admin user.CF_ADMIN_PASSWORD: The password for the admin user.Optional:
THREADS: The number of parallel test nodes to run (default: 6).The script will generate a
wiretap-report.jsonfile in theoutdirectory, which contains a detailed report of the API interactions and any compliance issues found.flowchart TD A[CAPI BARA Tests] -->|HTTP Request| B[Wiretap Proxy] B -->|HTTP Request| C[CF API Server] C -->|HTTP Response| B B -->|HTTP Response| AContract Testing (Mock Server)
yarn test:mockserver <spec-file>Executes the
bin/test-mockserver.jsscript to run contract tests against a running server (either a live API or a mock server). This script useswiretapto validate that the server’s responses conform to the OpenAPI specification.Example:
This is useful for:
capi-bara-testssuite.Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue to discuss any changes.
License
This project is licensed under the Apache-2.0 License. See the LICENSE file for details.