HUBComponentTargetJSONSchema
@protocol HUBComponentTargetJSONSchema <NSObject>
Protocol defining the public API of a JSON schema for HUBComponentTarget
You don’t conform to this protocol yourself, instead an object matching the default Hub Framework schema will
come attached to a HUBJSONSchema
. You are free to customize a schema in whatever way you want, but you must
do so before registering it with the HUBJSONSchemaRegistry
.
The Hub Framework uses a path-based approach to JSON parsing, that enables you to describe how to retrieve data
from a JSON structure using paths - sequences of operations that each perform a JSON parsing task, such as going
to a key in a dictionary, or iterating over an array. For more information about how to construct paths, see the
documentation for HUBJSONPath
and HUBMutableJSONPath
.
All paths in this schema are relative to a dictionary containing target data for a component.
-
The path to follow to extract a target URI string. Maps to
URI
.Declaration
Objective-C
@property (readwrite, strong, nonatomic) id<HUBJSONURLPath> _Nonnull URIPath;
-
The path to follow to extract an initial view model dictionary for the target. Maps to
initialViewModel
.The dictionary extracted by following this path will then be parsed using
HUBViewModelJSONSchema
.Declaration
Objective-C
@property (readwrite, strong, nonatomic) id<HUBJSONDictionaryPath> _Nonnull initialViewModelDictionaryPath;
-
The path to follow to extract an array of action identifiers for the target. Maps to
actionIdentifiers
.Declaration
Objective-C
@property (readwrite, strong, nonatomic) id<HUBJSONStringPath> _Nonnull actionIdentifiersPath;
-
The path to follow to extract any custom data for the target. Maps to
customData
.Declaration
Objective-C
@property (readwrite, strong, nonatomic) id<HUBJSONDictionaryPath> _Nonnull customDataPath;
-
Create a copy of this schema, with the same paths
Declaration
Objective-C
- (nonnull id<HUBComponentTargetJSONSchema>)copy;