All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Now uses NodeJS 16.10.X+ (not tested with NodeJS 12.X.X)
- GitHub Action to publish automatically in NPM registry after each new release (https://docs.github.com/en/packages/quickstart#publishing-your-package)
- Updated all depdendencies and devDependencies
- Removed unused dependencies (may be re-added in the future)
- Added support for response type:
This add new methods to "api model" template:
- isResponseTypeText
- isResponseTypeJson
- isResponseTypeXML
- isResponseTypeFile
API Base(angular 2):- Support for "response types" (this fix download files)
API Base(angular 2):- Now
falsevalues are sent to Back End, previously was ignored likenullandundefined.
- Now
- Fix prebuild fse-remove -> fse remove in package.json
- Support for arrays in
apiresponses.
API Base(angular 2):- Added
body(data) forpatchrequest - Fix
repsonseTypetype forHttpOptions - ModelBase
stringfynow return parameters that arefalse - ModelBase parse method fixed
- Added
- Parser for Components -> Parameters
- The parameters are added in a new store and are "copied" when are needed in the models or responses.
- Added
$refsupport in theComponents- As the standard specifies, it will COPY the referenced
$refobject only changing themodel name, so the other attributes are ignored.
- As the standard specifies, it will COPY the referenced
copy-pluggable-filescommand was broken, so templates were not copied to dist folder- Debugger tasks which call
copy-pluggable-files
This change add some beta features (but are stable).
- Engine to generate a
mock server(the task is done after write all files). json-serverfor themock engine(beta).- Method to resolve "pluggable" elements (
resolvePluggablePath).
- Core template paths (default templates) are moved inside
srcto be coherent with themock engineand also add native support for TS (future versions). - The "pluggable" folders now are coppied to the
buildfolder to be published within the package, otherwise thetemplateswill be ignored from this version and also themock assets. - Specify
template(andoutput-folder) is now optional, so you can createmockswithout generate all files.- Also you can simply launch this script to check if the
json/yamldocument is "well formed" (compatible with the script, there are some missing OpenAPI 3 features not added yet).
- Also you can simply launch this script to check if the
- Now
buildfolder is empty before each compilation.
This can break your
angular 2app, now all APIs require a model instance. Also returns an instance, this can be a big break change, please test your app after build (in another branch) and fix all manually.
- Added support for numeric enums
- In "api-model":
- "contentType" (request)
- In "model-attributes" model:
- isTypePrimitive
- isNotPrimitive
API Base(angular 2):- You can add to your angular without doing changes
- Removed all store dependences
- Removed handle error
Angular 2template:- Added "model-base" which are extended by all generated models to parse/stringfy models
- Added "mapping" to all API responses (with model-base)
- Support for https remote files
- Added but not used swagger2openapi to future validations (and first method to convert Swagger 2 to OpenAPI V3 with this library)
- Support for
Swagger 1andSwagger 2 (Open API)files (using api-spec-converter which converts the file toOpenAPI V3.
- APIs: If no
tagsprovided, the URL is splitted and used astags.
--config-fileparameterindex.tsfile which export the main classes and functions to work pragmatically from nodejs (pending docs)
### Fixed
- save-file alias for cli
- main.ts config usage
- Prepush hook
- Parameter to choose where to save the
open api (swagger) fileif--fileis anURL. Default path is./open-api(.json/.yaml added automatically).
- Now "properties" inside "properties" inside "schema" are transformed to an object, previously was
any.
- Issue #12 - Support for multi array in api schemes
- JSON example
Angular 2generated example (partial, not all files are uploaded)
- Now
generatedfolder is no created anymore.
Please update your repositories or your "output" folder will be cleared on the next execution. You have to specify explicity
generatedfolder or your desired one.
- Fix "Capitalize" on api's (it was creating files and classes with spaces)
- Issue #3 - Custom templates: Now you can create a custom template and use it without modify the source code.
- Issue #6 - Custom enums mapping: As part of a template, enums are configurable.
- Issue #7 - Default templates support. Now current template is named
angular2, so you must to add-t angular2to youcli script
transform-swagger -f ...json -o src/generatedApi/ -t angular2ConfigModelclassTemplateConfigModelclass
- Output folders now are retrieved from ConfigModel.
- Now
templateis required as parameter. - Default type added.
Yargs(arguments) are not read directly, are parsed toConfigModel.
- If schema has not been defined,
anywill set again (insteadvoid). This undoes2.1.2partially.
- Added Elvis operator to all 'isXXX' internal conditional in
parser-base.service.ts
- New types to default mapping: File and Void
- If response schema is "empty" (ex: json -> with no content) it will detect as `void instead throw an error.
- Enums in "models" (components) and schemas now generated.
- Now
-vis available as parameter as--versionalias.
- Auto-generated types (parameters, request body, ... without explicit declaration) forced to to CapitalCase (UpperCamelCase).
Please check and update your code after generate the template.
- "Native" types previously was generating a new model in parameters or other cases.
- Forced
groupName(class name) to CapitalCase (UpperCamelCase).
Please check and update your code after generate the template.
- nodemon: added "templates" folder
- Removed empty comments in the generated files
- Getter/Setter for verb in API
- API template "verb" was wrong
- nodemon settings for start:dev
- Readme.md install command
- Moved package.json from devDependencies to dependencies
templatesfolder moved torootfolder
- Removed unused
mkdirpdependencie - Removed unused
rxjsdependencie