Skip to content

Commit abb62b7

Browse files
committed
[RFC] Document CF API with OpenAPI
1 parent cb2cd72 commit abb62b7

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# Meta
2+
3+
- Name: Documenting the CF API with OpenAPI
4+
- Start Date: 2025-06-27
5+
- Author(s): @flothinkspi
6+
- Status: Draft
7+
- RFC Pull Request: [community#1112](https://github.com/cloudfoundry/community/pull/1112)
8+
9+
## Summary
10+
11+
With the acceptance of
12+
[RFC-32](https://github.com/cloudfoundry/community/blob/d7b48620d0da3bcadeea18aaf64f6fa36c329e7f/toc/rfc/rfc-0032-cfapiv2-eol.md),
13+
a problem arises for users of CF who rely on unsupported client
14+
libraries that are not maintained and just work with the deprecated CF V2 API. To ensure the success of
15+
[RFC-32](https://github.com/cloudfoundry/community/blob/d7b48620d0da3bcadeea18aaf64f6fa36c329e7f/toc/rfc/rfc-0032-cfapiv2-eol.md)
16+
and to enable users to better transition to the V3 API, and also future-proof the CF API documentation, this RFC proposes
17+
to document the CF API V3 using the OpenAPI specification.
18+
19+
## Problem
20+
21+
## Motivation
22+
23+
1. Improve the overall CF user experience, increasing the adoption and
24+
popularity of CloudFoundry.
25+
26+
2. Support the adoption of
27+
[RFC-32](https://github.com/cloudfoundry/community/blob/d7b48620d0da3bcadeea18aaf64f6fa36c329e7f/toc/rfc/rfc-0032-cfapiv2-eol.md)
28+
by offering an more user-friendly path for users away from the CF V2 API.
29+
30+
3. Provide a widely adopted documentation format (OpenAPI) that enables many new usecases from programatic access to the CF API docs and schema to generating Documentation pages, automatic tests of documentation vs implementation or also better AI Agent integration.
31+
32+
## Proposal
33+
34+
### Documenting the CF V3 API with OpenAPI
35+
36+
With [OpenAPI](https://www.openapis.org/), APIs can be defined in a
37+
machine-readable format (YAML), enabling the generation of client
38+
libraries for various programming languages and the rendering of
39+
interactive HTML API documentation. The OpenAPI specification is widely
40+
adopted and supported by many tools. A [Proof of Concept
41+
(PoC)](https://github.com/FloThinksPi/cf-api-openapi-poc) and [another Proof of Concept](https://github.com/cloudfoundry-community/capi-openapi-spec) is already
42+
exploring the documentation of the CF V3 API as an OpenAPI spec,
43+
providing a glimpse (currently with incorrect content) of the potential
44+
look and feel of this documentation format.
45+
46+
The CloudFoundry organization MAY document the CF API V3 using the
47+
OpenAPI specification. Which then can be used by CF Maintainers or CF Users to
48+
leverage a huge toolchain around OpenAPI to generate client libraries, documentation pages, and more. This MAY render a transition like for example from a unsupported client library that only supports the CF V2 api towards using the CF V3 api a lot more easier since the available toolchain around OpenAPI is big, valuable, a time saver and then available to CF Users.
49+
Such usecases include for example:
50+
51+
- [Swagger UI](https://swagger.io/tools/swagger-ui/) for interactive API documentation.
52+
- [Swagger Codegen](https://swagger.io/tools/swagger-codegen/) for generating client libraries
53+
- [OpenAPI Generator](https://openapi-generator.tech/) for generating client libraries and server stubs in various languages.
54+
- [Redoc](https://redocly.com/redoc/) for generating static API documentation.
55+
- [Postman](https://www.postman.com/) for API testing and documentation.
56+
- [Dredd](https://dredd.org/en/latest/) for testing API documentation against the implementation.
57+
- [AI Agents](https://github.com/janwilmake/openapi-mcp-server) for improved integration with AI-powered tools.
58+
59+
### Phases
60+
61+
**Implementation** - Convert <https://github.com/cloudfoundry-community/capi-openapi-spec> to a repository in the official cloudfoundry organization.Document the CF API V3 using the OpenAPI specification. Also generate a html documentation to replace the current page. Optionally build up, if possible, a validation(integration test) that validates if the OpenAPI spec is in sync with the actual implementation of the CF API V3.
62+
63+
**Checkpoint** - TOC review and approval of the project, ensuring the
64+
OpenAPI documentation is complete in comparison to the current one and of appropriate quality. Replacement of the current CF API V3 website with representing the OpenAPI spec. Also release the OpenAPI spec for programmatic access to the CF API V3 documentation.
65+
66+
## Impact and Consequences
67+
68+
### Positive
69+
70+
- CF may see an increase in adoption and popularity due to improved
71+
usability and user experience and the use of a documentation format
72+
(OpenAPI) that is widely adopted in the industry and integrates well
73+
with other tools. The time needed to develop against the CF API may
74+
decrease, leading to faster implementation for users and increased statisfaction.
75+
76+
- The OpenAPI documentation format empowers users with unique
77+
requirements to generate their own client libraries or starter
78+
templates, providing an exceptional user experience for specialized
79+
use cases.
80+
81+
- The OpenAPI documentation enables programmatic access to the CF API
82+
documentation and schema, allowing for automatic tests of
83+
documentation vs implementation, and better AI Agent integration. A lot of new usecases and adoption may arise from this.
84+
85+
- May reduce backpressure onto
86+
[RFC-32](https://github.com/cloudfoundry/community/blob/d7b48620d0da3bcadeea18aaf64f6fa36c329e7f/toc/rfc/rfc-0032-cfapiv2-eol.md)
87+
due to better enabling of users to transition to the V3 API.
88+
89+
### Negative
90+
91+
- The CloudFoundry organization will have to invest time and resources
92+
to document the CF API V3 using the OpenAPI specification and work on two documentation formats in parallel until the OpenAPI is so mature that it can fully replace the existing documentation.

0 commit comments

Comments
 (0)