Skip to content

Commit

Permalink
ci: Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
seambot committed Jun 20, 2024
1 parent f0f6cea commit 2e0e665
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
18 changes: 9 additions & 9 deletions src/lib/blueprint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import type { Openapi } from './openapi.js'
export interface Blueprint {
name: string
language: string
methodDescription: string
category: string
methodDescription: string
category: string
parameters: Array<{
name: string
type: string
name: string
type: string
required: boolean
description: string
description: string
}>
returnValue: {
type: string
description: string
type: string
description: string
}
examples: Array<{
codeSnippet: string
explanation: string
codeSnippet: string
explanation: string
}>
}

Expand Down
14 changes: 8 additions & 6 deletions src/lib/openapi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { openapi } from "@seamapi/types/connect"
import { openapi } from '@seamapi/types/connect'

interface SchemaObject {
properties?: Record<string, any>
Expand Down Expand Up @@ -43,7 +43,7 @@ export interface Openapi {
const extractSchemas = (schemas: Schemas): Schema[] => {
return Object.entries(schemas).map(([schemaName, schema]) => ({
name: schemaName,
properties: (schema.properties != null) ? Object.keys(schema.properties) : [],
properties: schema.properties != null ? Object.keys(schema.properties) : [],
}))
}

Expand All @@ -55,21 +55,23 @@ const extractPaths = (paths: Paths): ApiPath[] => {

if (operationDetails.responses?.['200'] !== undefined) {
const response = operationDetails.responses['200']
const description = typeof response.description === 'string' ? response.description : ''
const schemaProperties = response.content?.["application/json"]?.schema?.properties ?? {}
const description =
typeof response.description === 'string' ? response.description : ''
const schemaProperties =
response.content?.['application/json']?.schema?.properties ?? {}

successfulResponse = {
description,
schemaProperties,
type: response.content["application/json"].schema.type,
type: response.content['application/json'].schema.type,
}
}

return {
method: method.toUpperCase(),
successfulResponse,
}
})
}),
}))
}

Expand Down

0 comments on commit 2e0e665

Please sign in to comment.