Skip to main content

AMF initialization

After you add the AMF initialize method to your application code, you can initialize AMF and register the plugins you intend to use.

The initialization method, AMF.init() registers the following plugins:

  • WebApi
  • Vocabularies
  • AMFCustomValidation
  • PayloadValidatorPlugin

The AMF.init() method initializes the core functions of AMF by running amf.Core.init(), as show in the following snippet:

AMF.scala
def init(executionEnvironment: BaseExecutionEnvironment): ClientFuture[Unit] = {
WebApi.register(executionEnvironment)
Vocabularies.register()
AMFCustomValidation.register()
amf.Core.registerPlugin(PayloadValidatorPlugin)
amf.Core.init(executionEnvironment)
}

Depending on your use case, you can cherry-pick and use only the plugins you need. For example, if you wanted to parse and resolve the OAS 3.0 specification, you would need only the WebApi plugin:

WebApi.register();
Core.init().get();

For more information on parsing, see Parsing with AMF.

Last updated on by Isaac Eldridge