Class ContractParser
java.lang.Object
com.arc_e_tect.gradle.apionly.transcriberj.model.ContractParser
Builds a
ContractModel from a bundled OpenAPI 3 contract.
Bundled means self-contained: every $ref in a schema points at a schema
component in the same document, which is what the API-Only Publisher produces.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ContractModelParses a contract's text.static ContractModelParses a contract file, read as UTF-8.
-
Method Details
-
parse
Parses a contract file, read as UTF-8.- Parameters:
file- the contract- Returns:
- the model
- Throws:
IOException- when the file cannot be readContractModelException- when it is not a bundled OpenAPI 3 contract; the message starts with the file's path
-
parse
Parses a contract's text.- Parameters:
text- the contract, as YAML or JSONsource- what to call the contract in error messages- Returns:
- the model
- Throws:
ContractModelException- when it is not a bundled OpenAPI 3 contract; the message starts withsource
-