Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
"inputEntityDefinition": {
  "name": "ExampleGetSingleProductInput",
  "fields": {
    "productId": {
      "type": "long",
      "input": {
        "httpMethods": [ "GET", "PATCH" ],
        "source": "path",
        "requiredHttpMethods" : ["PATCH"]
      },
      "productName" : {
        "httpMethods" : [ "PATCH" ],  //allow caller to update productName
        "source" : "body"
      }
    }
  }
}

The takeaway here is that we didn't have to duplicate a lot of metadata.  It might not seem like much when you only have one input field, but as your endpoints start accepting more client input this becomes a time saver.  How you reuse the metadata across endpoints is covered in the section on references.  

...