Skip to content

Commit

Permalink
Merge pull request #105 from samchon/feat/allOf
Browse files Browse the repository at this point in the history
Fix #104: conversion OpenAPI version when `allOf.length` is 1.
  • Loading branch information
samchon authored Dec 4, 2024
2 parents 2ccc87f + fe4f81e commit 8b84e90
Show file tree
Hide file tree
Showing 7 changed files with 2,258 additions and 170 deletions.
1,983 changes: 1,983 additions & 0 deletions examples/v2.0/semanticscholar.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@samchon/openapi",
"version": "2.0.0",
"version": "2.0.1",
"description": "OpenAPI definitions and converters for 'typia' and 'nestia'.",
"main": "./lib/index.js",
"module": "./lib/index.mjs",
Expand Down
3 changes: 2 additions & 1 deletion src/converters/OpenApiV3Upgrader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,8 @@ export namespace OpenApiV3Upgrader {
if (TypeChecker.isAnyOf(schema)) schema.anyOf.forEach(visit);
else if (TypeChecker.isOneOf(schema)) schema.oneOf.forEach(visit);
else if (TypeChecker.isAllOf(schema))
union.push(convertAllOfSchema(components)(schema));
if (schema.allOf.length === 1) visit(schema.allOf[0]);
else union.push(convertAllOfSchema(components)(schema));
// ATOMIC TYPE CASE (CONSIDER ENUM VALUES)
else if (
TypeChecker.isBoolean(schema) ||
Expand Down
3 changes: 2 additions & 1 deletion src/converters/OpenApiV3_1Emender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ export namespace OpenApiV3_1Emender {
else if (TypeChecker.isOneOf(schema)) schema.oneOf.forEach(visit);
else if (TypeChecker.isAnyOf(schema)) schema.anyOf.forEach(visit);
else if (TypeChecker.isAllOf(schema))
union.push(convertAllOfSchema(components)(schema));
if (schema.allOf.length === 1) visit(schema.allOf[0]);
else union.push(convertAllOfSchema(components)(schema));
// ATOMIC TYPE CASE (CONSIDER ENUM VALUES)
else if (TypeChecker.isBoolean(schema))
if (
Expand Down
Loading

0 comments on commit 8b84e90

Please sign in to comment.