Skip to content
Closed
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
9 changes: 7 additions & 2 deletions packages/openapi-generator/src/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,23 @@ export function schemaToOpenAPI(
switch (schema.type) {
case 'boolean':
case 'string':
case 'number':
return {
type: schema.type,
...(schema.enum ? { enum: schema.enum } : {}),
...defaultOpenAPIObject,
};
case 'integer':
case 'number':
return {
type: 'number',
...(schema.enum ? { enum: schema.enum } : {}),
...defaultOpenAPIObject,
};
case 'integer':
return {
type: 'integer',
...(schema.enum ? { enum: schema.enum } : {}),
...defaultOpenAPIObject,
};
case 'null':
// TODO: OpenAPI v3 does not have an explicit null type, is there a better way to represent this?
// Or should we just conflate explicit null and undefined properties?
Expand Down
2 changes: 1 addition & 1 deletion website/docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ logic is never called with data it can't handle.

[parse, don't validate]:
https://lexi-lambda.github.io/blog/2019/11/05/parse-don-t-validate/
[type and semantic analysis]:
[type and semantic validation]:
https://bitgo.github.io/api-ts/docs/tutorial-basics/create-an-api-spec/#what-problem-does-io-ts-http-solve
2 changes: 1 addition & 1 deletion website/src/components/HomepageFeatures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default function HomepageFeatures() {
),
},
{
title: 'API definition',
title: 'API Specification',
lightSvg: require('@site/static/img/api-m-light-blue.svg').default,
darkSvg: require('@site/static/img/api-m-dark-blue.svg').default,
description: (
Expand Down