Skip to content

WIP - Convert Fabric APIs to TypeSpec #373

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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
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
457 changes: 457 additions & 0 deletions .cursor/rules/openapi-comparison-prompt.md

Large diffs are not rendered by default.

649 changes: 649 additions & 0 deletions .cursor/rules/typespec.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"scripts": {
"build": "yarn --cwd website build",
"serve": "yarn --cwd website serve",
"start": "yarn --cwd website start",
"start-fresh": "yarn --cwd website start-fresh",
"build:website": "yarn --cwd website build",
Expand Down
10 changes: 5 additions & 5 deletions specs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
"prebuild": "yarn clean"
},
"dependencies": {
"@typespec/compiler": "1.0.0",
"@typespec/http": "1.0.0",
"@typespec/openapi": "1.0.0",
"@typespec/openapi3": "1.0.0",
"@typespec/rest": "0.70.0"
"@typespec/compiler": "1.1.0",
"@typespec/http": "1.1.0",
"@typespec/openapi": "1.1.0",
"@typespec/openapi3": "1.1.0",
"@typespec/rest": "0.71.0"
},
"devDependencies": {
"typescript": "^5.5.4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
'422':
description: Client error
content:
Expand Down Expand Up @@ -66,19 +62,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
'422':
description: Client error
content:
Expand Down Expand Up @@ -531,6 +523,24 @@ components:
amount:
type: integer
description: Charged amount.
Types.StatusCodes.StatusCode401:
type: object
required:
- error
properties:
error:
type: string
enum:
- Unauthorized
Types.StatusCodes.StatusCode404:
type: object
required:
- error
properties:
error:
type: string
enum:
- Not Found
Types.StatusCodes.StatusCode422Error:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
'422':
description: Client error
content:
Expand Down Expand Up @@ -140,6 +136,24 @@ components:
allOf:
- $ref: '#/components/schemas/ChatState'
description: An arbitrary JSON object available to store stateful application information in. Must be valid JSON and have a maximum size of 2,000 characters.
Types.StatusCodes.StatusCode401:
type: object
required:
- error
properties:
error:
type: string
enum:
- Unauthorized
Types.StatusCodes.StatusCode404:
type: object
required:
- error
properties:
error:
type: string
enum:
- Not Found
Types.StatusCodes.StatusCode422Error:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
tags:
- Documents
post:
Expand All @@ -53,19 +49,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
'422':
description: Client error
content:
Expand Down Expand Up @@ -98,19 +90,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
'422':
description: Client error
content:
Expand Down Expand Up @@ -142,19 +130,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
tags:
- Chunks
/documents/{documentId}/chunks/{chunkId}:
Expand All @@ -175,19 +159,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
tags:
- Chunks
delete:
Expand All @@ -203,19 +183,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
tags:
- Chunks
/documents/{id}:
Expand All @@ -235,19 +211,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
'422':
description: Client error
content:
Expand All @@ -274,19 +246,15 @@ paths:
'401':
description: Access is unauthorized.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Unauthorized
$ref: '#/components/schemas/Types.StatusCodes.StatusCode401'
'404':
description: The server cannot find the requested resource.
content:
text/plain:
application/json:
schema:
type: string
enum:
- Not Found
$ref: '#/components/schemas/Types.StatusCodes.StatusCode404'
tags:
- Documents
security:
Expand Down Expand Up @@ -747,6 +715,24 @@ components:
message: Invalid tags
attribute: tags
url: https://developer.signalwire.com/rest/overview/error-codes#{code}
Types.StatusCodes.StatusCode401:
type: object
required:
- error
properties:
error:
type: string
enum:
- Unauthorized
Types.StatusCodes.StatusCode404:
type: object
required:
- error
properties:
error:
type: string
enum:
- Not Found
Types.StatusCodes.StatusCode422Error:
type: object
required:
Expand Down
5 changes: 0 additions & 5 deletions specs/signalwire-rest/fabric-api/_category_.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import "./models/request.tsp";
import "./models/responses.tsp";

Loading