-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #478 from zenml-io/UAT
Uat
- Loading branch information
Showing
249 changed files
with
13,226 additions
and
1,502 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const fs = require('fs'); | ||
const openapiTS = require('openapi-typescript'); | ||
|
||
// Logging function with emojis | ||
function log(message, emoji) { | ||
console.log(`${emoji} ${message}`); | ||
} | ||
|
||
(async () => { | ||
log('Script started.', '✨'); | ||
|
||
const output = await openapiTS('https://appserver.zenml.io/openapi.json', { | ||
exportType: true, | ||
transform: (schema) => { | ||
customTransformer(schema); | ||
}, | ||
}); | ||
|
||
log('Writing output to file...', '📝'); | ||
fs.writeFileSync('schema.d.ts', output); | ||
|
||
log('Script completed successfully.', '✅'); | ||
})(); | ||
|
||
/** | ||
* | ||
* @param {import("openapi-typescript").SchemaObject} schema | ||
* @returns {import("openapi-typescript").SchemaObject} | ||
*/ | ||
function customTransformer(schema) { | ||
if (schema.type === 'object' && !schema.properties) { | ||
schema.additionalProperties = true; | ||
} | ||
return schema; | ||
} |
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.