1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Source-format adapters.
//!
//! The codegen core only consumes [`crate::Api`]. An [`Adapter`] is the
//! public boundary for bringing another source format into that neutral model;
//! it also carries security definitions which cannot be inferred from an
//! operation's named requirements alone. OpenAPI parsing is supplied by
//! Poolster's embedded Go compiler, whose JSON artifacts are read by
//! [`openapi_sidecar`].
use Result;
use crate::;
pub use OpenApiSidecar;
/// A normalized input contract ready for language plugins.
///
/// Adapters should preserve source-specific information in [`Api::annotations`]
/// where it is useful to a generic transform, rather than exposing their
/// parser's internal types to generators. An empty security catalog is valid
/// for formats without reusable credential definitions.
/// Converts a source contract into Poolster's target-neutral AST.
///
/// Implement this trait in an application or integration crate to support
/// formats such as AsyncAPI, GraphQL, or a company-specific contract format.
/// It is deliberately synchronous and object-safe, so adapters can be passed
/// as `&dyn Adapter` when a caller selects an input format at runtime.
///
/// Output customization does not use a separate parser trait: it belongs to
/// Poolster's existing [`crate::engine::Language`] and [`crate::engine::Plugin`]
/// extension points after an adapter has produced an [`Api`].