Stancer.APIGenerator (stancer v0.1.0)

Copy Markdown

Generates API modules from OpenAPI specification.

Creates a module hierarchy like:

  • Stancer.API.Customers
  • Stancer.API.Customers.list/0
  • Stancer.API.Customers.create/1
  • Stancer.API.Customers.get/1
  • Stancer.API.Customers.update/2
  • Stancer.API.Customers.delete/1

All generated from the Stancer OpenAPI spec at compile time.

Summary

Functions

Generate module definitions for all resources.

Parse OpenAPI spec and group endpoints by resource.

Functions

generate_resource_modules(spec)

Generate module definitions for all resources.

Returns a list of module AST that can be quoted/unquoted.

parse_resources_from_spec(spec)

Parse OpenAPI spec and group endpoints by resource.

Returns a map of resources to their endpoints.