Packages
oaspec
0.64.0
0.68.0
0.67.0
0.66.0
0.65.0
0.64.0
0.63.0
0.62.0
0.61.0
0.60.0
0.59.0
0.58.1
0.58.0
0.57.0
0.56.0
0.55.0
0.54.0
0.53.0
0.52.0
0.51.0
0.50.0
0.49.0
0.48.0
0.47.0
0.46.0
0.45.0
0.44.0
0.43.0
0.42.0
0.41.0
0.40.0
0.39.0
0.38.0
0.37.0
0.36.0
0.35.0
0.34.0
0.33.0
0.32.0
0.31.0
0.30.0
0.29.0
0.28.0
0.27.0
0.26.0
0.25.0
0.24.0
0.23.0
0.22.0
0.21.0
0.20.0
0.19.0
0.18.0
0.17.0
0.16.0
0.15.0
0.14.0
0.13.0
0.12.0
0.11.0
0.10.0
0.9.0
0.8.0
0.7.0
0.6.3
0.6.1
0.6.0
0.5.0
0.4.0
0.3.0
0.1.3
Generate Gleam code from OpenAPI 3.x specifications
Current section
Files
Jump to
Current section
Files
gleam.toml
name = "oaspec"
version = "0.64.0"
target = "erlang"
description = "Generate Gleam code from OpenAPI 3.x specifications"
licences = ["MIT"]
repository = { type = "github", user = "nao1215", repo = "oaspec" }
internal_modules = ["oaspec/internal/**"]
[dependencies]
gleam_stdlib = ">= 0.44.0 and < 2.0.0"
gleam_json = ">= 3.0.0 and < 4.0.0"
glint = ">= 1.0.0 and < 2.0.0"
simplifile = ">= 2.0.0 and < 3.0.0"
yay = ">= 2.0.0 and < 3.0.0"
argv = ">= 1.0.0 and < 2.0.0"
gleam_regexp = ">= 1.0.0 and < 2.0.0"
filepath = ">= 1.1.0 and < 2.0.0"
[dev-dependencies]
gleeunit = ">= 1.0.0 and < 2.0.0"
gleescript = ">= 1.0.0 and < 2.0.0"
glinter = ">= 2.14.0 and < 3.0.0"
metamon = ">= 0.5.0 and < 1.0.0"
[tools.glinter]
stats = true
warnings_as_errors = true
include = ["src/", "test/"]
# The executable test surface is now split into stage-specific modules, but
# the extracted support module still holds the legacy case bodies. Glinter's
# current analysis remains quadratic in module size, so keep that support file
# excluded while linting every smaller entrypoint module.
exclude = ["test/oaspec_support.gleam"]
# Every rule is set to "error" for the strictest configuration.
# function_complexity, module_complexity, unwrap_used and ffi_usage default
# to "off" inside glinter; enabling them here still reports any hits with
# severity "off" (they do not fail the build), but they are left in for
# visibility.
[tools.glinter.rules]
assert_ok_pattern = "error"
avoid_panic = "error"
avoid_todo = "error"
deep_nesting = "error"
discarded_result = "error"
division_by_zero = "error"
duplicate_import = "error"
echo = "error"
error_context_lost = "error"
ffi_usage = "error"
function_complexity = "error"
label_possible = "error"
missing_labels = "error"
missing_type_annotation = "error"
module_complexity = "error"
panic_without_message = "error"
prefer_guard_clause = "error"
redundant_case = "error"
short_variable_name = "error"
string_inspect = "error"
stringly_typed_error = "error"
thrown_away_error = "error"
todo_without_message = "error"
trailing_underscore = "error"
unnecessary_string_concatenation = "error"
unnecessary_variable = "error"
unqualified_import = "error"
unused_exports = "error"
unwrap_used = "error"
# Per-file rule suppressions. Each entry lists rules that are intentionally
# ignored in that file; prefer fixing the underlying issue over expanding
# this list.
[tools.glinter.ignore]
# Public test functions are auto-discovered by gleeunit via reflection, so
# they legitimately look "unused" and lack explicit return annotations.
"test/*.gleam" = [
"unused_exports",
"missing_type_annotation",
"assert_ok_pattern",
"label_possible",
]
# Stage-specific wrapper modules intentionally delegate to shared support-case
# functions and ignore their heterogeneous return values; lint the case bodies
# themselves rather than forcing every wrapper call to pattern-match.
"test/oaspec_*_test.gleam" = ["discarded_result"]
# transport_test exercises with_default_header*'s panic surface via
# capture_panic; the unused wrapper return value (a fn(Request) -> a)
# is intentional — the test only cares whether construction panicked
# before the fn was returned. (#546)
"test/transport_test.gleam" = ["discarded_result"]
# Codegen and OpenAPI traversal code takes many unlabelled helper
# parameters and is naturally branchy; fixing these cleanly would require a
# project-wide refactor that is out of scope for enabling glinter.
"src/oaspec/internal/cli.gleam" = ["label_possible", "deep_nesting"]
"src/oaspec/config.gleam" = ["label_possible"]
"src/oaspec/internal/capability.gleam" = ["label_possible"]
"src/oaspec/internal/formatter.gleam" = ["label_possible"]
"src/oaspec/generate.gleam" = ["label_possible", "deep_nesting"]
# schema_dispatch.gleam uses panic for unsupported inline complex schemas
# (object/allOf/oneOf/anyOf) in decoder/encoder dispatch — these patterns
# must fail fast instead of silently generating broken code (#290).
"src/oaspec/internal/codegen/*.gleam" = ["label_possible", "deep_nesting", "avoid_panic"]
"src/oaspec/codegen/writer.gleam" = ["label_possible"]
# transport.gleam validates header names / values for CR/LF/NUL injection
# at construction time (#546). The panic surfaces a security-relevant
# misconfiguration immediately rather than silently propagating a
# poison value to the wire — a Result-returning signature would force
# every caller to handle a never-error case for a literal-string call
# site.
"src/oaspec/transport.gleam" = ["avoid_panic"]
"src/oaspec/internal/openapi/*.gleam" = ["label_possible", "deep_nesting"]
"src/oaspec/openapi/parser.gleam" = ["label_possible", "deep_nesting"]
"src/oaspec/openapi/diagnostic.gleam" = ["label_possible"]
"src/oaspec/internal/util/*.gleam" = ["label_possible", "deep_nesting"]
# naming.gleam memoizes its three pre-compiled regexes via a tiny
# `oaspec_naming_ffi:memoize/2` helper backed by `persistent_term`.
# This is the only FFI in the project; the lint rule stays on
# everywhere else (Issue #405).
"src/oaspec/internal/util/naming.gleam" = ["label_possible", "deep_nesting", "ffi_usage"]