Class Oas31KeywordScanner
- java.lang.Object
-
- org.openapitools.codegen.languages.Oas31KeywordScanner
-
public final class Oas31KeywordScanner extends Object
OAS 3.1 dialect resolution and exhaustive schema-keyword scanning.swagger-parser and swagger-models do not retain every OAS 3.1 schema surface. This class resolves the effective document dialect and records the schema keywords visible after parsing. Keywords are classified as emitted, annotation-only, or explicitly rejected; unsupported required vocabularies and unnormalized dynamic references fail closed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classOas31KeywordScanner.KeywordOccurrenceOne keyword occurrence at a schema-valued position.static classOas31KeywordScanner.KeywordOccurrenceLedgerOrdered keyword occurrence ledger with status aggregation.static classOas31KeywordScanner.KeywordOccurrenceStatusClassification of one visible keyword occurrence.
-
Field Summary
Fields Modifier and Type Field Description static StringVOCAB_APPLICATORApplicator vocabulary identifier (2020-12).static StringVOCAB_CONTENTContent vocabulary identifier (2020-12).static StringVOCAB_CORECore vocabulary identifier (2020-12).static StringVOCAB_FORMATFormat-annotation vocabulary identifier (2020-12).static StringVOCAB_METADATAMetadata vocabulary identifier (2020-12).static StringVOCAB_OAS_BASEOAS base vocabulary identifier (OAS 3.1).static StringVOCAB_UNEVALUATEDUnevaluated vocabulary identifier (2020-12).static StringVOCAB_VALIDATIONValidation vocabulary identifier (2020-12).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Set<String>failClosedKeywords(io.swagger.v3.oas.models.OpenAPI api)Set of fail-closed required-vocabulary keywords actually encountered for this document (the keywords the generator refuses rather than silently accepting).static CppBoostBeastModelCodegen.OasDialectresolveDocumentDialect(io.swagger.v3.oas.models.OpenAPI api)Resolve the effective dialect of an OpenAPI document from its knobs.static CppBoostBeastModelCodegen.OasDialectresolveEffectiveDialect(String jsonSchemaDialect, String rootSchema)Resolve the effective schema dialect from the top-leveljsonSchemaDialectand/or the root$schema.static Oas31KeywordScanner.KeywordOccurrenceLedgerscanSchemaKeywordOccurrences(io.swagger.v3.oas.models.OpenAPI api)Exhaustive schema-valued-position scanner.static List<String>validateDialectPolicy(io.swagger.v3.oas.models.OpenAPI api)Dialect/metaschema policy gate: a dialect identifier that is not recognized by this program must be refused (unknown required vocabulary).static List<String>validateNormativeOas3Structure(io.swagger.v3.oas.models.OpenAPI api)OAS 3 structural normative checks.
-
-
-
Field Detail
-
VOCAB_CORE
public static final String VOCAB_CORE
Core vocabulary identifier (2020-12).- See Also:
- Constant Field Values
-
VOCAB_APPLICATOR
public static final String VOCAB_APPLICATOR
Applicator vocabulary identifier (2020-12).- See Also:
- Constant Field Values
-
VOCAB_UNEVALUATED
public static final String VOCAB_UNEVALUATED
Unevaluated vocabulary identifier (2020-12).- See Also:
- Constant Field Values
-
VOCAB_VALIDATION
public static final String VOCAB_VALIDATION
Validation vocabulary identifier (2020-12).- See Also:
- Constant Field Values
-
VOCAB_METADATA
public static final String VOCAB_METADATA
Metadata vocabulary identifier (2020-12).- See Also:
- Constant Field Values
-
VOCAB_FORMAT
public static final String VOCAB_FORMAT
Format-annotation vocabulary identifier (2020-12).- See Also:
- Constant Field Values
-
VOCAB_CONTENT
public static final String VOCAB_CONTENT
Content vocabulary identifier (2020-12).- See Also:
- Constant Field Values
-
VOCAB_OAS_BASE
public static final String VOCAB_OAS_BASE
OAS base vocabulary identifier (OAS 3.1).- See Also:
- Constant Field Values
-
-
Method Detail
-
resolveEffectiveDialect
public static CppBoostBeastModelCodegen.OasDialect resolveEffectiveDialect(String jsonSchemaDialect, String rootSchema)
Resolve the effective schema dialect from the top-leveljsonSchemaDialectand/or the root$schema. Per OAS 3.1 the root$schema(when present at a document/schema-resource root) takes precedence overjsonSchemaDialectfor that resource.
-
resolveDocumentDialect
public static CppBoostBeastModelCodegen.OasDialect resolveDocumentDialect(io.swagger.v3.oas.models.OpenAPI api)
Resolve the effective dialect of an OpenAPI document from its knobs.
-
validateNormativeOas3Structure
public static List<String> validateNormativeOas3Structure(io.swagger.v3.oas.models.OpenAPI api)
OAS 3 structural normative checks. Returns a list of human-readable diagnostics; an empty list means the structure is normative. The caller decides whether to fail generation (strict mode).
-
validateDialectPolicy
public static List<String> validateDialectPolicy(io.swagger.v3.oas.models.OpenAPI api)
Dialect/metaschema policy gate: a dialect identifier that is not recognized by this program must be refused (unknown required vocabulary). The OAS 3.1 default applies when an OAS 3.1 document declares nojsonSchemaDialect.Required vocabularies and resource-level dialect selectors are checked on every schema surface visible through swagger-models.
-
scanSchemaKeywordOccurrences
public static Oas31KeywordScanner.KeywordOccurrenceLedger scanSchemaKeywordOccurrences(io.swagger.v3.oas.models.OpenAPI api)
Exhaustive schema-valued-position scanner. Walks component schemas plus every inline schema reachable from paths, webhooks, callbacks, reusable parameters, headers, request bodies, responses, and path items. Each schema is then traversed through every schema-valued JSON Schema 2020-12 child keyword. Reference targets ($ref) are not followed here; reusable targets are scanned at their component location.
-
-