Skip to content

Terradue/taskfile-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

93 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

taskfile-utils

This project contains a Taskfile collection for different purposes to avoid redundancies in each project.

!!! note

In order to use remote tasks, since it is still an [experimental feature](https://taskfile.dev/experiments/remote-taskfiles/), please remind to set the `TASK_X_REMOTE_TASKFILES` environment variable:
export TASK_X_REMOTE_TASKFILES=1

Command execution

AsyncAPI

The asyncapi.yaml file contains tasks to generate contents, given an AsyncAPI document:

invoke_generator

Allow invoke the AsyncAPI Generator command (it will be installed, if not present), with arbitrary parameters:

  • API: the reference to the AsyncAPI document, typically a YAML document;
  • TEMPLATE: the AsyncAPI Generator template, i.e. @asyncapi/html-template@3.0.0, see the related documentation;
  • OUTPUT: the reference to the directory where the AsyncAPI Generator produces the output file(s);
  • AUX_PARAMETER: any auxiliary AsyncAPI Generator parameter(s).

generate_docs

By wrapping the previous command, generates an HTML human-readable document, with arbitrary parameters:

  • API: the reference to the AsyncAPI document, typically a YAML document;
  • OUTPUT: the reference to the directory where the AsyncAPI Generator produces the output file(s).

generate_models

Given an input OpenAPI YAML document, generates Pydantic v2 models, with arbitrary parameters:

  • API: the reference to the AsyncAPI document, typically a YAML document;
  • OUTPUT: the reference to the directory where the AsyncAPI Generator produces the output file(s).

JSON

The json.yaml file contains tasks to generate contents, given a JSON Schema document:

create_models

Given a JSON Schema, generates the related Pydantic v2 models (with field aliases), with arbitrary parameters:

  • SCHEMA: the reference to a JSON Schema file (it can be expressed as a YAML file).
  • OUTPUT: the reference to the directory where the AsyncAPI Generator produces the output file(s).

Optional parameters below are also supported:

  • BASE_CLASS: the Pydantic v2 base class, pydantic.BaseModel by default.
  • DEBUG: set to true to enable datamodel-codegen --debug output during model generation.

check_instance

Executes a strict JSON Schema check of an instance file against an input schema, with arbitrary parameters:

  • SCHEMA: the reference to a JSON Schema file (it can be expressed as a YAML file).
  • INSTANCE: the reference to the instance file that can needs to be checked against the input schema.

OpenAPI

The openapi.yaml file contains tasks to generate contents, given an OpenAPI document:

generate_docs

Generates an HTML Redocly human-readable document, with arbitrary parameters:

  • API: the reference to the OpenAPI document, typically a YAML document;
  • OUTPUT: the reference to the the output file where documentation will be produced.

generate_skeleton

Given an input OpenAPI document, generates a FastAPI server skeleton with Pydantic v2 models, with arbitrary parameters:

  • API: the reference to the OpenAPI document, typically a YAML document;
  • OUTPUT: the reference to the directory where the the output file(s) will be produced.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors