Package org.brapi.schematools.analyse
Class BrAPISpecificationAnalyserFactory
java.lang.Object
org.brapi.schematools.analyse.BrAPISpecificationAnalyserFactory
Analyses BrAPI endpoints against an OpenAPI Specification
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAnalyser provides direct access to the analysis functions. -
Constructor Summary
ConstructorsConstructorDescriptionBrAPISpecificationAnalyserFactory(String baseURL, HttpClient client, AuthorizationProvider authorizationProvider) Create an Analyser FactoryBrAPISpecificationAnalyserFactory(String baseURL, HttpClient client, AuthorizationProvider authorizationProvider, AnalysisOptions options) Create an Analyser -
Method Summary
Modifier and TypeMethodDescriptionorg.brapi.schematools.core.response.Response<List<AnalysisReport>> Creates a new analyser and analyses all the endpoints in the specification.org.brapi.schematools.core.response.Response<List<AnalysisReport>> Creates a new analyser and analyses the endpoints for specific entities in the specification.Creates a new analyser for a specification.org.brapi.schematools.core.response.Response<org.brapi.schematools.core.validiation.Validation> Creates a new analyser and validates the options against the specification.
-
Constructor Details
-
BrAPISpecificationAnalyserFactory
public BrAPISpecificationAnalyserFactory(String baseURL, HttpClient client, AuthorizationProvider authorizationProvider) Create an Analyser Factory- Parameters:
baseURL- the base URl for the BrAPI serverclient- the HTTP client to use for the execution of requestsauthorizationProvider- the authorization provider need for authorization
-
BrAPISpecificationAnalyserFactory
public BrAPISpecificationAnalyserFactory(String baseURL, HttpClient client, AuthorizationProvider authorizationProvider, AnalysisOptions options) Create an Analyser- Parameters:
baseURL- the base URl for the BrAPI serverclient- the HTTP client to use for the execution of requestsauthorizationProvider- the authorization provider need for authorizationoptions- analysis options ;
-
-
Method Details
-
analyse
public org.brapi.schematools.core.response.Response<List<AnalysisReport>> analyse(String specification, Path schema) Creates a new analyser and analyses all the endpoints in the specification. Shortcut forAnalysisOptions.validate(),BrAPISpecificationAnalyserFactory.Analyser.analyseSpecial()andBrAPISpecificationAnalyserFactory.Analyser.analyseAll().- Parameters:
specification- the OpenAPI specification to br analysed.- Returns:
- A response containing a list of AnalysisReports or failure explaining why it failed.
-
analyse
public org.brapi.schematools.core.response.Response<List<AnalysisReport>> analyse(String specification, List<String> entityNames) Creates a new analyser and analyses the endpoints for specific entities in the specification. Shortcut forAnalysisOptions.validate(),BrAPISpecificationAnalyserFactory.Analyser.analyseSpecial()andBrAPISpecificationAnalyserFactory.Analyser.analyseEntities(List).- Parameters:
specification- the OpenAPI specification to br analysed.entityNames- a list of entities to be analysed- Returns:
- A response containing a list of AnalysisReports or failure explaining why it failed.
-
validate
public org.brapi.schematools.core.response.Response<org.brapi.schematools.core.validiation.Validation> validate(String specification) Creates a new analyser and validates the options against the specification. Shortcut forAnalysisOptions.validate()- Parameters:
specification- the OpenAPI specification to br analysed.- Returns:
- A response containing a list of AnalysisReports or failure explaining why it failed.
-
analyser
Creates a new analyser for a specification. Used for fine control over the analysis. It is recommended to use the factory directlyanalyse(String, List)(String)} oranalyse(String, List)which handles option validation and the pre-processing steps, like callingBrAPISpecificationAnalyserFactory.Analyser.analyseSpecial()- Parameters:
specification- the OpenAPI specification to br analysed.- Returns:
- A response containing a list of AnalysisReports or failure explaining why it failed.
-