Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Generates express validators/routers/controllers in Typescript using an OpenAPI 3 spec.
A support library designed to work with the yeoman
generator,
apifire-server
.
It takes an OpenAPI 3 spec, and generates routes, controllers, and validators for express in Typescript.
This library is a work-in-progress (alpha level, in my opinion), and works specifically with the author's use-cases.
It's been tested with the following files:
tests/openapi3/petstore.yaml
tests/openapi3/bt-example.yaml
tests/openapi3/spotlight-example.yaml
Notes:
$ref
is supported in responses and parametersparameters
to define non-post body params, use requestBody
for body paramsapplication/json
is only supported for requestBody
and responsesThis library is a fork of the openapi3-generator
project.
json-schema-ref-parser-alt
build that adds a x-original-ref
property as a reference to the
original $ref
to the output schema, which is useful for static analysis when trying to generate types.openapi3-generator
were removed.apifire-server
.To use it from the CLI:
npm install -g apifire
In the directory where the apifire-server
generated service is, run:
$ apifire api.yaml api-server
Where api.yaml
is the OpenAPI 3 spec file. You should always run this command whenever the spec
file changes.
This will generate the following structure:
/<service root>
├── src/
| ├── controllers-generated/
| | └── <operation>.ts
| ├── interfaces/
| | └── api.ts
| ├── routers/
| | ├── <operation>.router.ts
| | ├── validators/
| | | └── <operation>.validator.ts
In day-to-day usage, the controllers-generated/
directory contains the files that you may edit / pluck
to the service's controllers/
directory as you will implement your business logic in them.
The other directories and their files should never be modified.
Usage: apifire [options] <openapiFileOrURL> <template>
Options:
-V, --version output the version number
-o, --output <outputDir> directory where to put the generated files (defaults to current directory)
-t, --templates <templateDir> directory where templates are located (defaults to internal templates directory)
-b, --basedir <baseDir> directory to use as the base when resolving local file references (defaults to OpenAPI file directory)
-h, --help output usage information
FAQs
Generates express validators/routers/controllers in Typescript using an OpenAPI 3 spec.
The npm package apifire receives a total of 10 weekly downloads. As such, apifire popularity was classified as not popular.
We found that apifire demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.