diff --git a/CHANGELOG.md b/CHANGELOG.md index 9faa170..7ac00f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,13 +4,19 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). The format is based on [Keep a Changelog](http://keepachangelog.com/). -## Version 1.0.1 - 02.03.2024 +## Version 1.0.2 - 02.05.2024 ### Fixed - Bug fixes -## Version 1.0.0 - 02.03.2024 +## Version 1.0.1 - 02.05.2024 + +### Fixed + +- Bug fixes + +## Version 1.0.0 - 02.05.2024 ### Added diff --git a/README.md b/README.md index 2c527a1..2dec441 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ $ npm install @cap-js/openapi ### Usage ```sh -require("@cap-js/openapi").registerOpenapiCompileTarget() +require("@cap-js/openapi").register() ``` ## Generate OpenAPI document diff --git a/index.js b/index.js index 6832364..a9bb076 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ function _lazyRegisterCompileTarget() { return value } -const registerOpenapiCompileTarget = () => { +const register = () => { Object.defineProperty(cds.compile.to, "openapi", { get: _lazyRegisterCompileTarget, configurable: true @@ -14,4 +14,4 @@ const registerOpenapiCompileTarget = () => { } -module.exports = { registerOpenapiCompileTarget } +module.exports = { register } diff --git a/package.json b/package.json index 6119be2..c69e936 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cap-js/openapi", - "version": "1.0.1", + "version": "1.0.2", "description": "CAP tool for OpenAPI", "repository": { "type": "git", diff --git a/test/lib/compile/openapi.test.js b/test/lib/compile/openapi.test.js index f18ce35..c98330c 100644 --- a/test/lib/compile/openapi.test.js +++ b/test/lib/compile/openapi.test.js @@ -1,4 +1,4 @@ -require('../../..').registerOpenapiCompileTarget(); +require('../../..').register(); const cds = require('@sap/cds') const { compile: { to: { openapi: toOpenApi } } } = cds