Skip to content

Commit bafef2a

Browse files
committed
Initial OpenAPI spec setup
0 parents  commit bafef2a

File tree

11 files changed

+945
-0
lines changed

11 files changed

+945
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Validate OpenAPI Specs
2+
3+
on:
4+
push:
5+
paths:
6+
- 'components/**.yaml'
7+
- 'services/**.yaml'
8+
- 'responses/**.yaml'
9+
pull_request:
10+
paths:
11+
- 'components/**.yaml'
12+
- 'services/**.yaml'
13+
- 'responses/**.yaml'
14+
15+
jobs:
16+
validate:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Node.js
23+
uses: actions/setup-node@v3
24+
with:
25+
node-version: '20'
26+
27+
- name: Install swagger-cli
28+
run: npm install -g swagger-cli
29+
30+
- name: Validate OpenAPI spec
31+
run: |
32+
swagger-cli validate main.yaml --verbose
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update Website Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'openapi.json'
8+
- 'openapi.yaml'
9+
- 'docs/**'
10+
- '*.md'
11+
12+
jobs:
13+
update-website:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout openapi repo
17+
uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- name: Trigger website deployment
22+
run: |
23+
curl -X POST \
24+
-H "Authorization: token ${{ secrets.WEBSITE_DEPLOY_TOKEN }}" \
25+
-H "Accept: application/vnd.github.v3+json" \
26+
https://api.github.com/repos/marketdataapi/website/dispatches \
27+
-d '{"event_type": "openapi-updated", "client_payload": {"sha": "${{ github.sha }}", "ref": "${{ github.ref }}"}}'
28+

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
dist/
3+
output.txt

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
## MarketDataAPI.com — OpenAPI Specifications
2+
3+
# Overview
4+
5+
This repository hosts the official OpenAPI (Swagger) specification files for **MarketDataAPI.com**, enabling
6+
standardized integration with MarketDataAPI’s financial data services.
7+
8+
* Specification standard: **OpenAPI 3.1.0**
9+
* API reference: [https://www.marketdataapi.com/docs](https://www.marketdataapi.com/docs)
10+
11+
# Repository Contents
12+
13+
API definitions are provided in multiple serialization formats for interoperability:
14+
15+
```txt
16+
openapi/
17+
components/
18+
schemas.yaml # Shared schemas across services
19+
responses.yaml # Shared response objects
20+
services/
21+
search/
22+
v1.yaml
23+
```
24+
25+
# Compatibility
26+
27+
* Fully compliant with **OpenAPI Specification**.
28+
* Suitable for code generation, validation, documentation, and client/server scaffolding.
29+
30+
# Support & Issue Tracking
31+
32+
* Bugs, technical issues, and feature requests: **GitHub Issues**.
33+
* General inquiries and assistance: [https://www.marketdataapi.com/help](https://www.marketdataapi.com/help).
34+
35+
# License
36+
37+
* Open source under the **MIT License**.
38+
* See the `LICENSE` file for full terms.

SETUP.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Setup
2+
3+
Install openapitools
4+
5+
```
6+
npm i -g @openapitools/openapi-generator-cli
7+
```
8+
9+
Build locally
10+
11+
```
12+
openapi-generator-cli validate -i main.yaml
13+
openapi-generator-cli generate \
14+
-i main.yaml \
15+
-g openapi-yaml \
16+
-o dist
17+
```
18+
19+
Install redocly
20+
21+
```
22+
npm i -g @redocly/cli
23+
```
24+
25+
Serve locally
26+
27+
```
28+
redocly preview -d dist
29+
```
30+

components/responses.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
openapi: 3.1.0
2+
info:
3+
title: MarketDataAPI.com - Shared Responses
4+
version: 'v1'
5+
6+
components:
7+
responses:
8+
BadRequest:
9+
description: Invalid request parameters
10+
content:
11+
application/problem+json:
12+
schema:
13+
$ref: './schemas.yaml#/components/schemas/ProblemDetail'
14+
15+
Unauthorized:
16+
description: Authentication failed
17+
content:
18+
application/problem+json:
19+
schema:
20+
$ref: './schemas.yaml#/components/schemas/ProblemDetail'
21+
22+
TooManyRequests:
23+
description: Rate limit exceeded
24+
content:
25+
application/problem+json:
26+
schema:
27+
$ref: './schemas.yaml#/components/schemas/ProblemDetail'
28+
29+
PaymentRequired:
30+
description: Subscription required for this endpoint
31+
content:
32+
application/problem+json:
33+
schema:
34+
$ref: './schemas.yaml#/components/schemas/ProblemDetail'
35+
36+
Forbidden:
37+
description: Authenticated but forbidden
38+
content:
39+
application/problem+json:
40+
schema:
41+
$ref: './schemas.yaml#/components/schemas/ProblemDetail'
42+
43+
NotFound:
44+
description: Resource not found
45+
content:
46+
application/problem+json:
47+
schema:
48+
$ref: './schemas.yaml#/components/schemas/ProblemDetail'
49+
50+
InternalServerError:
51+
description: Unexpected server error
52+
content:
53+
application/problem+json:
54+
schema:
55+
$ref: './schemas.yaml#/components/schemas/ProblemDetail'

0 commit comments

Comments
 (0)