Skip to content

Instantly share code, notes, and snippets.

@klokane
Last active November 17, 2019 22:05
Show Gist options
  • Save klokane/5db775ba78ef90d5f3c0a17c6c4aba32 to your computer and use it in GitHub Desktop.
Save klokane/5db775ba78ef90d5f3c0a17c6c4aba32 to your computer and use it in GitHub Desktop.
MSON ideas

Canned Responses

## Generic Responses(*T*)
- Include (*T*)

## Default 4XX
+ Response 404 (application/json)
   - message: Not Found
   
+ Response 401 (application/json)
  - message: Not Authorized
  

# Blog Posts [/posts/{id}]

Following request contains predefined `Default 4xx`
WARN: it is not valid syntax - just idea how we can implement predefined responses 

+ Request (application/json) (Generic Resource(Default 4XX))
   ...

+ Response 200
   ...

Or maybe little bit simple just by allowing inheritance for + Request?

## Default 4XX
+ Response 404 (application/json)
   - message: Not Found
   
+ Response 401 (application/json)
  - message: Not Authorized
  

# Blog Posts [/posts/{id}]

+ Request (application/json) (Default 4XX)
   ...

+ Response 200
   ...

Generic MSON

Multiple inheritance

## Multiple Inheritance (*S*, *T*)
- Include *S*
- Include *T*

## Mom (object)
- smart

## Dad (object)
- beautiful

## Smart and Nice Kid (Multiple Inheritance(Mom, Dad))
This object has all properties from both parents 

Variant

## Variant3 (*S*, *T*, *U*)
- One Of
  - *S*
  - *T*
  - *U*
  
## Queued
-  queeued_at

## Processed
- processed_at

## Done
- finished_at

## Item to be processed (Variant3(Queued, Processed, Done))
This item can be in one of three states

### Properties
- id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment