-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(util): various improvements
Signed-off-by: Stefan Blaginov <[email protected]>
- Loading branch information
Stefan Blaginov
committed
Feb 24, 2023
1 parent
e9ef5d6
commit bc6007b
Showing
20 changed files
with
881 additions
and
203 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -584,21 +584,22 @@ class Commands { | |
let schema = JSON.parse(fs.readFileSync(input, 'utf8')); | ||
|
||
if (format.toLowerCase() === 'openapi'){ | ||
const inferredConcertoJsonModel = ( | ||
new CodeGen.OpenApiDefinition(schema) | ||
).accept( | ||
(new CodeGen.OpenApiToConcertoVisitor), | ||
{ | ||
metaModelNamespace: '[email protected]', | ||
namespace, | ||
}, | ||
); | ||
const inferredConcertoJsonModel = CodeGen.OpenApiToConcertoVisitor | ||
.parse(schema) | ||
.accept( | ||
(new CodeGen.OpenApiToConcertoVisitor), | ||
{ | ||
metaModelNamespace: '[email protected]', | ||
namespace, | ||
}, | ||
); | ||
|
||
return Printer.toCTO( | ||
inferredConcertoJsonModel.models[0] | ||
); | ||
} | ||
const inferredConcertoJsonModel = (new CodeGen.JsonSchemaModel(schema)) | ||
const inferredConcertoJsonModel = CodeGen.JSONSchemaToConcertoVisitor | ||
.parse(schema) | ||
.accept( | ||
(new CodeGen.JSONSchemaToConcertoVisitor), | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.