Giter VIP home page Giter VIP logo

fs-mock-api's Introduction

FS Mock API

FS Mock API is a node.js app designed to be used as a mock API service for unit testing SDKs.

Requests to the app are mapped to a file in the data folder by concatentating the HTTP request method with the request path. Then the media type is used to lookup either the JSON or XML response.

Data sent in the request body of a POST is not validated.

Example

GET /platform/tree/persons/12345/spouse-relationships
Accept: application/x-fs-v1+json

will open the GET-platform-tree-persons-12345-spouse-relationships.json file and return the following response:

HTTP/1.1 200 OK
Content-Type: application/xx-fs-v1+json

{
  "relationships": [
    {
      "type": "http://gedcomx.org/Couple",
      "facts": [
        {
          "type": "http://gedcomx.org/Marriage",
          "date": {
            "original": "1 January 1786"
          },
          "place": {
            "original": "Boston, MA"
          }
        }
      ],
      "person1": {
        "resource": "/tree/persons/KJ8T-GZ1",
        "resourceId": "KJ8T-GZ1"
      },
      "person2": {
        "resource": "/tree/persons/KJ8T-GZ2",
        "resourceId": "KJ8T-GZ2"
      },
      "links": {
        "relationship": {
          "title": "Couple Relationship",
          "href": "https://familysearch.org/platform/tree/couple-relationships/KJ8T-GZ0"
        },
        "person1": {
          "title": "Conclusions",
          "href": "https://familysearch.org/platform/tree/persons/12345"
        },
        "person2": {
          "title": "Conclusions",
          "href": "https://familysearch.org/platform/tree/persons/12345"
        },
        "woman": {
          "title": "Conclusions",
          "href": "https://familysearch.org/platform/tree/persons/12345"
        },
        "man": {
          "title": "Conclusions",
          "href": "https://familysearch.org/platform/tree/persons/12345"
        }
      },
      "id": "KJ8T-GZ0"
    }
  ],
  "links": {
    "person": {
      "title": "Conclusions",
      "href": "https://familysearch.org/platform/tree/persons/12345"
    }
  }
} 

fs-mock-api's People

Contributors

justincy 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.