Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: split OpenAPI specification into multiple files #24

Merged
merged 6 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint OpenAPI definition

# Run workflow on push to any branch
on:
push:
branches:
- '*'

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Install Redocly CLI
run: npm install -g @redocly/cli

- name: Lint Openapi spec
run: redocly lint openapi.yaml
22 changes: 0 additions & 22 deletions .github/workflows/main.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Release OpenAPI definition

# Run workflow on release
on:
release:
types: [published]

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout this repo
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 'lts/*'

- name: Install Redocly CLI
run: npm install -g @redocly/cli

- name: Bundle Openapi spec
run: redocly bundle openapi.yaml -o openapi-bundled.yaml

- name: Add bundled Openapi spec to release
uses: softprops/action-gh-release@v1
if: ${{startsWith(github.ref, 'refs/tags/') }}
with:
files: openapi-bundled.yaml

- name: Sync Openapi spec
uses: readmeio/rdme@v9
with:
rdme: openapi upload ./openapi.yaml --key=${{ secrets.README_API_KEY }} --id=64d389d9f6e898001137e15b
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea
.vscode
bundled.yaml
70 changes: 11 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,63 +1,15 @@
# OAS
Foxentry API reference OpenAPI file used in Foxentry API reference on [Foxentry.dev](https://foxentry.dev)
# Foxentry OpenAPI specification

```
:::::::: ::: ::: ::: :::: ::: :::::::: :::::::::: ::: :::::::: ::::::::
:+: :+: :+: :+: :+: :+: :+:+: :+: :+: :+: :+: :+: :+: :+: :+: :+:
+:+ +:+ +:+ +:+ +:+ :+:+:+ +:+ +:+ +:+ +:+ +:+ +:+ +:+
+#+ +#++:++#++ +#++:++#++: +#+ +:+ +#+ :#: +#++:++# +#+ +#+ +:+ :#:
+#+ +#+ +#+ +#+ +#+ +#+ +#+#+# +#+ +#+# +#+ +#+ +#+ +#+ +#+ +#+#
#+# #+# #+# #+# #+# #+# #+# #+#+# #+# #+# #+# #+# #+# #+# #+# #+#
######## ### ### ### ### ### #### ######## ########## ########## ######## ########
```

Date format: **YYYY-MM-DD**

***
## 2024/10/03<br>
- Fixed various typos & added better description for resultsLimit
<br><br>

## 2024/10/03<br>
- Added missing fields and descriptions
- Added missing error 400
- Added various minor fixes
<br><br>

## 2024/06/04<br>
- added countryFormat option for company requests
<br><br>

## 2024/06/04<br>
- fixed capitalization of header names
- deprecated the defaultPrefix option
<br><br>
This repository contains the OpenAPI specification for the Foxentry API.
The specification can be seen on the [Foxentry.dev](https://foxentry.dev) developer hub.

## 2024/05/13<br>
- added allowPartialResults to LocationRequestOptionsSearch
## Contributing
The specification is split into multiple files, the main file is `openapi.yaml`.
Most viewers and editors can handle this without any problems, but you can always bundle the files together.

## 2024/04/25<br>
- added preferredPrefixes to ValidatePhoneNumberRequest options
- fixed empty arrays not having items defined
- fixed typos, added and updated descriptions
<br><br>

## 2024/04/23<br>
- added missing examples and default values
- added response headers
<br><br>

## 2024/03/20<br>
- added missing enum values to the FixFormatGlobal object
<br><br>

## 2023/10/25<br>
- added new proposal values for endpoint email/validate (unknownWithCorrection, unknownWithPartialCorrection)
- updated query definition for endpoint phone/validate
<br><br>

## 2023/10/19 - New options for company endpoints <br>
- Added new cityFormat and zipFormat options for endpoints company/get, company/search and company/validate <br><br>
To generate the bundled file, you can use [redocly-cli](https://github.com/Redocly/redocly-cli) utility, running the following command:
```bash
redocly bundle openapi.yaml -o openapi-bundled.yaml
```

## 2023/09/20 - The first official version <br>
- This is the first official public version. Yay! <br><br>
You can also find the bundled file in the releases section of this repository.
4 changes: 4 additions & 0 deletions components/headers/Foxentry-Api-Version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
schema:
type: string
example: '2.0'
description: The version of the Foxentry API
4 changes: 4 additions & 0 deletions components/headers/Foxentry-Daily-Credits-Left.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
schema:
type: number
example: 9881.64
description: The amount of daily credits left
4 changes: 4 additions & 0 deletions components/headers/Foxentry-Daily-Credits-Limit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
schema:
type: number
example: 1000
description: The daily credits limit
4 changes: 4 additions & 0 deletions components/headers/Foxentry-Rate-Limit-Period.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
schema:
type: integer
example: 900
description: The rate limit period
4 changes: 4 additions & 0 deletions components/headers/Foxentry-Rate-Limit-Remaining.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
schema:
type: integer
example: 4999
description: The remaining rate limit
4 changes: 4 additions & 0 deletions components/headers/Foxentry-Rate-Limit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
schema:
type: integer
example: 5000
description: The rate limit
8 changes: 8 additions & 0 deletions components/parameters/Api-Version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: api-version
in: header
description: API version.
required: false
schema:
type: string
default: '2.0'
example: '2.0'
8 changes: 8 additions & 0 deletions components/parameters/Foxentry-Include-Request-Details.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: foxentry-include-request-details
in: header
description: Parameter to add details of your request.
required: false
schema:
type: boolean
default: false
example: false
30 changes: 30 additions & 0 deletions components/requestBodies/company/CompanyGetRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
content:
application/json:
schema:
type: object
properties:
request:
type: object
allOf:
- $ref: ./../../schemas/requestBodies/company/CompanyGetBody.yaml
required:
- query
required:
- request
examples:
Request Example:
value:
request:
query:
country: CZ
registrationNumber: '04997476'
options:
dataScope: full
includeTerminatedSubjects: false
cityFormat: basic
zipFormat: false
client:
country: CZ
location:
lat: 50.0628
lon: 13.9271
36 changes: 36 additions & 0 deletions components/requestBodies/company/CompanySearchRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
content:
application/json:
schema:
type: object
properties:
request:
type: object
allOf:
- $ref: ./../../schemas/requestBodies/company/CompanySearchBody.yaml
required:
- query
required:
- request
examples:
Request Example:
value:
request:
query:
type: name
value: ava
filter:
country: CZ
options:
dataScope: basic
resultsLimit: 10
includeTerminatedSubjects: false
filterMode: limit
filterAcceptFormat: true
filterExactMatch: true
cityFormat: basic
zipFormat: false
client:
country: CZ
location:
lat: 50.0628
lon: 13.9271
32 changes: 32 additions & 0 deletions components/requestBodies/company/CompanyValidationRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
content:
application/json:
schema:
type: object
properties:
request:
type: object
allOf:
- $ref: ./../../schemas/requestBodies/company/CompanyValidationBody.yaml
required:
- query
required:
- request
examples:
Request Example:
value:
request:
query:
name: AVANTRO
country: CZ
registrationNumber: '04997476'
options:
dataScope: basic
resultsLimit: 10
includeTerminatedSubjects: false
cityFormat: basic
zipFormat: false
client:
country: CZ
location:
lat: 50.0628
lon: 13.9271
26 changes: 26 additions & 0 deletions components/requestBodies/email/EmailSearchRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
content:
application/json:
schema:
type: object
properties:
request:
type: object
allOf:
- $ref: ./../../schemas/requestBodies/email/EmailSearchBody.yaml
required:
- query
required:
- request
examples:
Request Example:
value:
request:
query:
value: p.novak@
options:
resultsLimit: 5
client:
country: CZ
location:
lat: 50.0628
lon: 13.9271
28 changes: 28 additions & 0 deletions components/requestBodies/email/EmailValidationRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
content:
application/json:
schema:
type: object
properties:
request:
type: object
allOf:
- $ref: ./../../schemas/requestBodies/email/EmailValidationBody.yaml
required:
- query
required:
- request
examples:
Request Example:
value:
request:
query:
email: [email protected]
options:
validationType: extended
acceptDisposableEmails: true
acceptFreemails: true
client:
country: CZ
location:
lat: 50.0628
lon: 13.9271
23 changes: 23 additions & 0 deletions components/requestBodies/location/LocationGetRequest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
content:
application/json:
schema:
type: object
properties:
request:
type: object
allOf:
- $ref: ./../../schemas/requestBodies/location/LocationGetBody.yaml
required:
- query
required:
- request
examples:
Request Example:
value:
request:
query:
country: CZ
id: d2ade877-1e95-4a83-baa6-5431ce5b3ca8
options:
idType: internal
dataScope: full
Loading