Files
marvel-service/docs/data/documentation/marvelservice.json
T

1 line
42 KiB
JSON
Raw Normal View History

{"sections":[],"abstract":[{"text":"A library that allows the developer to interact with the ","type":"text"},{"inlineContent":[{"type":"text","text":"Marvel Comics API"}],"type":"strong"},{"text":" backend service.","type":"text"}],"identifier":{"url":"doc:\/\/MarvelService\/documentation\/MarvelService","interfaceLanguage":"swift"},"primaryContentSections":[{"content":[{"level":2,"anchor":"Overview","text":"Overview","type":"heading"},{"inlineContent":[{"type":"text","text":"The "},{"inlineContent":[{"text":"MarvelService","type":"text"}],"type":"strong"},{"text":" library is a package that allows the developer to interact with all the available endpoints of the ","type":"text"},{"type":"reference","identifier":"https:\/\/developer.marvel.com","isActive":true},{"type":"text","text":"."}],"type":"paragraph"},{"type":"heading","level":2,"anchor":"Installation","text":"Installation"},{"inlineContent":[{"type":"text","text":"This library can be integrated into your library, tool, and\/or app as an added dependency into any "},{"type":"codeVoice","code":"Package.swift"},{"type":"text","text":" file or Xcode project with the "},{"identifier":"https:\/\/developer.apple.com\/documentation\/xcode\/swift-packages","type":"reference","isActive":true},{"text":".","type":"text"}],"type":"paragraph"},{"inlineContent":[{"type":"text","text":"Heres an example of how to add this library as a dependency into a "},{"type":"codeVoice","code":"Package.swift"},{"type":"text","text":" file:"}],"type":"paragraph"},{"syntax":"swift","code":["let package = Package("," \/\/ name, platforms, products, etc."," dependencies: ["," .package(url: \"https:\/\/github.com\/rock-n-code\/marvel-service\", from: \"1.0.0\"),"," \/\/ other dependencies"," ],"," targets: ["," .target("," name: \"SomeTarget\", "," dependencies: ["," .product(name: \"MarvelService\", package: \"marvel-service\"),"," ]"," )"," \/\/ other targets"," ]",")"],"type":"codeListing"},{"inlineContent":[{"type":"text","text":"In "},{"type":"reference","identifier":"https:\/\/developer.apple.com\/xcode\/","isActive":true},{"type":"text","text":", on the other hand, it is required to use the Xcode inerface to add dependencies into a project or workspace."}],"type":"paragraph"},{"type":"aside","style":"important","name":"Important","content":[{"type":"paragraph","inlineContent":[{"text":"Swift 5.10 or higher is required in order to build this library.","type":"text"}]}]},{"text":"Usage","anchor":"Usage","type":"heading","level":2},{"inlineContent":[{"text":"After adding the ","type":"text"},{"type":"codeVoice","code":"MarvelService"},{"text":" library as a dependency in the library, tool, and\/or application, as explained in the previous sec tion, then it is required to import the library.","type":"text"}],"type":"paragraph"},{"type":"codeListing","code":["import MarvelService"],"syntax":"swift"},{"type":"paragraph","inlineContent":[{"text":"Then a ","type":"text"},{"identifier":"doc:\/\/MarvelService\/documentation\/MarvelService\/Client","type":"reference","isActive":true},{"text":" must to be initialized. Although this type is highly configurable, and browsing through its documentation is highly recomendable; it requires three parameters to set the client correctly:","type":"text"}]},{"type":"orderedList","items":[{"content":[{"inlineContent":[{"inlineContent":[{"text":"a host URL to which the client connects to","type":"text"}],"type":"emphasis"},{"text":";","type":"text"}],"type":"paragraph"}]},{"content":[{"inlineContent":[{"inlineContent":[{"text":"a transport in charge of performing the HTTP operations","type":"text"}],"type":"emphasis"},{"text":";","type":"text"}],"type":"paragraph"}]},{"content":[{"inlineContent":[{"inlineContent":[{"text":"an authorization middleware configured with either an ","type":"text"},{"code":"api key","type":"codeVoice"},{"text":" or a ","type":"text"},{"code":"private+public","type":"codeVoice"},{"text":" keys","type":"text"}],"type":"emphasis"},{"text"