docs: consolidate design documentation and standardize crate English

This commit is contained in:
2026-10-12 14:58:00 +09:00
parent a633a53274
commit 4efb0ace1f
404 changed files with 4556 additions and 11654 deletions
+7
View File
@@ -0,0 +1,7 @@
# api-macros-impl
Procedural macro implementation for `api-macros`. It validates and normalizes trait declarations before generating metadata and adapters. It does not own runtime HTTP handling or application authorization decisions.
## Main entry points
- [`api`] — declaration normalization and code generation
+8 -1
View File
@@ -1,4 +1,4 @@
//! Implementation of `api-macros`.
#![doc = include_str!("../README.md")]
use std::collections::{BTreeMap, BTreeSet};
@@ -15,6 +15,13 @@ use syn::{
spanned::Spanned,
};
/// Macro boundary that normalizes a trait before generating each output.
///
/// Validate routes, operation IDs, and body/response constraints before generation.
/// Generate HTTP, WebSocket, and OpenAPI from one normalized model rather than interpreting
/// them independently, reducing differences between adapters for the same declaration.
/// Validation failures are compile errors; unsupported wire shapes are not implicitly
/// accepted as JSON.
#[proc_macro_attribute]
pub fn api(attr: TokenStream, item: TokenStream) -> TokenStream {
let attr = proc_macro2::TokenStream::from(attr);