Skip to content

Commit bc15363

Browse files
authored
chore: Update OpenAPI specs (#213)
1 parent 73697f6 commit bc15363

File tree

7 files changed

+2436
-28
lines changed

7 files changed

+2436
-28
lines changed

.github/workflows/changelog.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,13 @@ jobs:
1111
steps:
1212
- name: Get current date
1313
id: date
14+
env:
15+
GH_TOKEN: ${{ github.token }}
16+
PR_NUMBER: ${{ github.event.number }}
1417
run: |
15-
echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
18+
DATE=$(gh pr view --repo https://github.com/devrev/fern-api-docs ${{ env.PR_NUMBER }} --json createdAt --jq .[] | cut -d 'T' -f 1)
19+
echo "DATE=$DATE" >> $GITHUB_ENV
20+
echo "Date PR opened is ${{ env.DATE }}"
1621
- name: Check out repository content
1722
uses: actions/checkout@v2
1823
with:

changelog.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ def main(vrn, d):
1515
outfile.write(p)
1616
print(f"Wrote prompt to {pr_file}.")
1717

18+
print('Sending request to LLM.')
1819
l = llm_client.get_response(p)
19-
2020
log_file = f"./fern/apis/{vrn}/changelog/{d}.md"
2121
if (l):
2222
with open(log_file, 'w', encoding="utf-8") as outfile:
23-
outfile.write(l)
23+
outfile.write(llm_client.get_lines_between_tags(l, 'changelog'))
2424
print(f"Wrote log to {log_file}.")
2525
else:
26-
print(f"Failed to generate {log_file}.")
26+
print(f"Failed to generate {log_file}. No response from LLM.")
2727

2828

2929

@@ -32,7 +32,7 @@ def gen_prompt(oasdiff, links, version):
3232
oasdiff = infile.read()
3333

3434
prompt = f"""
35-
Please provide an API changelog for the {version} API from the following OASDiff of OpenAPI spec changes. The output should be in markdown format grouping endpoints by use case/object type. For cases where some schema is modified, please also tell what endpoints it affects. Wherever an endpoint, property, or enum value is mentioned, surround it with backticks (`). Wherever an API is mentioned, include a hyperlink to the corresponding path from `<api_links>` section.
35+
Please provide an API changelog for the {version} API from the following OASDiff of OpenAPI spec changes. The output should be in markdown format grouping endpoints by use case/object type. For cases where some schema is modified, please also tell what endpoints it affects. Wherever an endpoint, property, or enum value is mentioned, surround it with backticks (`). Use only H2 and H3 headings. Wherever an API is mentioned, include a hyperlink to the corresponding path from `<api_links>` section. Place the changelog in a `<changelog>` element in your response so I can parse it out.
3636
3737
<oasdiff>
3838
{oasdiff}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
## New Endpoints
3+
4+
### Service Accounts
5+
- Added [`POST /service-accounts.create`](/beta/api-reference/service-accounts/create) for creating service accounts
6+
7+
### Widgets
8+
- Added [`GET /widgets.get`](/beta/api-reference/widgets/get) for retrieving widgets
9+
10+
## Modified Features
11+
12+
### Customization
13+
- Added `is_overridable` property to schema enum fields
14+
15+
### Timeline
16+
- Added `references` property to timeline comments
17+
18+
### Parts
19+
- Added support for part types `linkable` and `runnable`

0 commit comments

Comments
 (0)