Skip to content

Commit

Permalink
fix(cli): Add OpenAPIRefResolver for external sources (#5804)
Browse files Browse the repository at this point in the history
  • Loading branch information
amckinney authored Jan 30, 2025
1 parent a5a234c commit 9366bf0
Show file tree
Hide file tree
Showing 15 changed files with 1,755 additions and 6 deletions.
3 changes: 0 additions & 3 deletions fern/pages/changelogs/ts-express/2025-01-29.mdx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,308 @@
{
"absoluteFilePath": "/DUMMY_PATH",
"importedDefinitions": {},
"namedDefinitionFiles": {
"__package__.yml": {
"absoluteFilepath": "/DUMMY_PATH",
"contents": {
"service": {
"auth": false,
"base-path": "",
"endpoints": {
"createAUser": {
"auth": false,
"display-name": "Create a user",
"docs": undefined,
"examples": [
{
"request": {},
"response": {
"body": {
"createdAt": "2024-01-15T09:30:00Z",
"email": "email",
"id": "id",
"name": "name",
"settings": {
"lastModified": "2024-01-15T09:30:00Z",
"notifications": true,
"theme": "theme",
},
"stats": {
"accountStatus": "active",
"lastLoginTime": "2024-01-15T09:30:00Z",
"totalLogins": 1,
},
},
},
},
],
"method": "POST",
"pagination": undefined,
"path": "/users",
"request": {
"body": {
"properties": {
"email": "optional<string>",
"name": "optional<string>",
"settings": "optional<UserSettings>",
},
},
"content-type": "application/json",
"headers": undefined,
"name": "UserCreate",
"path-parameters": undefined,
"query-parameters": undefined,
},
"response": {
"docs": "User created successfully",
"status-code": 200,
"type": "User",
},
"source": {
"openapi": "../openapi.yml",
},
},
"updateAUser": {
"auth": false,
"display-name": "Update a user",
"docs": undefined,
"examples": [
{
"request": {},
"response": {
"body": {
"createdAt": "2024-01-15T09:30:00Z",
"email": "email",
"id": "id",
"name": "name",
"settings": {
"lastModified": "2024-01-15T09:30:00Z",
"notifications": true,
"theme": "theme",
},
"stats": {
"accountStatus": "active",
"lastLoginTime": "2024-01-15T09:30:00Z",
"totalLogins": 1,
},
},
},
},
],
"method": "PUT",
"pagination": undefined,
"path": "/users",
"request": {
"body": {
"properties": {
"email": "optional<string>",
"lastName": "optional<string>",
"name": "optional<string>",
"settings": "optional<UserSettings>",
},
},
"content-type": "application/json",
"headers": undefined,
"name": "UserUpdate",
"path-parameters": undefined,
"query-parameters": undefined,
},
"response": {
"docs": "User updated successfully",
"status-code": 200,
"type": "User",
},
"source": {
"openapi": "../openapi.yml",
},
},
},
"source": {
"openapi": "../openapi.yml",
},
},
"types": {
"User": {
"docs": undefined,
"inline": undefined,
"properties": {
"createdAt": "optional<datetime>",
"email": "optional<string>",
"id": "optional<string>",
"name": "optional<string>",
"settings": "optional<UserSettings>",
"stats": "optional<UserStats>",
},
"source": {
"openapi": "../openapi.yml",
},
},
"UserSettings": {
"docs": undefined,
"inline": undefined,
"properties": {
"lastModified": "optional<datetime>",
"notifications": "optional<boolean>",
"theme": "optional<string>",
},
"source": {
"openapi": "../openapi.yml",
},
},
"UserStats": {
"docs": undefined,
"inline": undefined,
"properties": {
"accountStatus": "optional<UserStatsAccountStatus>",
"lastLoginTime": "optional<datetime>",
"totalLogins": "optional<integer>",
},
"source": {
"openapi": "../openapi.yml",
},
},
"UserStatsAccountStatus": {
"enum": [
"active",
"suspended",
"deleted",
"inactive",
],
"inline": true,
"source": {
"openapi": "../openapi.yml",
},
},
},
},
"rawContents": "service:
auth: false
base-path: ''
endpoints:
createAUser:
path: /users
method: POST
auth: false
source:
openapi: ../openapi.yml
display-name: Create a user
request:
name: UserCreate
body:
properties:
name: optional<string>
email: optional<string>
settings: optional<UserSettings>
content-type: application/json
response:
docs: User created successfully
type: User
status-code: 200
examples:
- request: {}
response:
body:
id: id
name: name
email: email
createdAt: '2024-01-15T09:30:00Z'
settings:
theme: theme
notifications: true
lastModified: '2024-01-15T09:30:00Z'
stats:
totalLogins: 1
lastLoginTime: '2024-01-15T09:30:00Z'
accountStatus: active
updateAUser:
path: /users
method: PUT
auth: false
source:
openapi: ../openapi.yml
display-name: Update a user
request:
name: UserUpdate
body:
properties:
name: optional<string>
email: optional<string>
settings: optional<UserSettings>
lastName: optional<string>
content-type: application/json
response:
docs: User updated successfully
type: User
status-code: 200
examples:
- request: {}
response:
body:
id: id
name: name
email: email
createdAt: '2024-01-15T09:30:00Z'
settings:
theme: theme
notifications: true
lastModified: '2024-01-15T09:30:00Z'
stats:
totalLogins: 1
lastLoginTime: '2024-01-15T09:30:00Z'
accountStatus: active
source:
openapi: ../openapi.yml
types:
UserSettings:
properties:
theme: optional<string>
notifications: optional<boolean>
lastModified: optional<datetime>
source:
openapi: ../openapi.yml
UserStatsAccountStatus:
enum:
- active
- suspended
- deleted
- inactive
inline: true
source:
openapi: ../openapi.yml
UserStats:
properties:
totalLogins: optional<integer>
lastLoginTime: optional<datetime>
accountStatus: optional<UserStatsAccountStatus>
source:
openapi: ../openapi.yml
User:
properties:
id: optional<string>
name: optional<string>
email: optional<string>
createdAt: optional<datetime>
settings: optional<UserSettings>
stats: optional<UserStats>
source:
openapi: ../openapi.yml
",
},
},
"packageMarkers": {},
"rootApiFile": {
"contents": {
"display-name": "OpenAPI overrides resolution",
"error-discrimination": {
"strategy": "status-code",
},
"name": "api",
},
"defaultUrl": undefined,
"rawContents": "name: api
error-discrimination:
strategy: status-code
display-name: OpenAPI overrides resolution
",
},
}
Loading

0 comments on commit 9366bf0

Please sign in to comment.