Git Product home page Git Product logo

angaaruriakhil / marvel-spring-api Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 79 KB

A Restful API written in Spring/Java which pulls information from the Marvel API, parses it and serves it via various endpoints. To use it, you must make a marvel account and obtain a public and private key via the Marvel Developer Portal: https://developer.marvel.com/

Java 100.00%
maven spring java marvel api json parser

marvel-spring-api's Introduction

Setup

To use this, you must create a marvel account and obtain a public and private key via the Marvel Developer Portal: https://developer.marvel.com/.
The endpoints to use are:

To obtain your hash:
Search for an online MD5 hash generator on Google and type 1 followed by your public key and your private key. No spaces.
This will give you your hash path variable.

This solution also uses gson as a Maven dependency instead of Jackson to parse the JSON response from the Marvel API. To implement gson, put spring.mvc.converters.preferred-json-mapper=gson into your application.properties and paste the following into your pom.xml file under dependencies:

<dependency>
   <groupId>com.google.code.gson</groupId>
   <artifactId>gson</artifactId>
   <version>2.8.8</version>
</dependency> 

Marvel Back End (Challenge Instructions)

The Marvel Comics API allows developers to access information about Marvel's vast library of comics. We want you to use the Marvel API (see http://developer.marvel.com/) to build a Characters API:

Part One:

  1. Serve an endpoint /characters that returns all the Marvel character ids only, in a JSON array of numbers.
    • Because Marvel API only returns max 100 records per request, you need to load all of them beforehand with your application, and cache it in memory or file, to efficiently serve your endpoint;
    • The request should be something like:
// GET /characters
[ 1009718, 1017100, 1009144, 1010699, 1016823, 1009148, 1011334,  ]

  1. Serve an endpoint /characters/{characterId} that contains the real-time data from the Marvel API /v1/public/characters/{characterId}, but containing only the following information about each character: id, name, description, thumbnail.
// GET /characters/1009718
{
 "id": 1009718,
 "name": "Wolverine",
 "description": "Born with super-human senses and the power to heal from almost any
wound, Wolverine was captured by a secret Canadian organization and given an
unbreakable skeleton and claws. Treated like an animal, it took years for him to
control himself. Now, he's a premiere member of both the X-Men and the Avengers.",
 "thumbnail": {
 "path": "http://i.annihil.us/u/prod/marvel/i/mg/2/60/537bcaef0f6cf",
 "extension": "jpg"
 }
}

Part Two:

  1. Enable a translated version to another language of the character’s description.

    • Accept a query parameter with the language ISO-639-1 code: /characters/ {characterId}?language={languageCode}.
    • Use any translation service of your choice, it can be an API or library, but the goal is to execute the translations in real-time.

  1. Create a Swagger specification for your Characters API that can be viewed with Swagger UI or imported to Postman

Constraints


On Completion

Also write a markdown README.md with instructions on how to:

  • Install any dependencies, files or environment variables your code requires
  • How to build and run your server

EXCLUDE FROM TEST

Partially complete tech test available here.. https://github.com/nology-tech/marvel-api/tree/main/src/main/java/com/nology/charactersAPI

marvel-spring-api's People

Contributors

angaaruriakhil avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.