Tag Info

New answers tagged

3

Consider removing empty or null values. If a property is optional or has an empty or null value, consider dropping the property from the JSON, unless there's a strong semantic reason for its existence. { "volume": 10, // Even though the "balance" property's value is zero, it should be left in, // since "0" signifies "even balance" (the value could ...


0

Your JSON data should contain the information that the user of the API expects. Which should mostly mean that it is documented and gives the information that is documented. The schema should not depend on your database design. And of course if your database design changes, the API cannot change. So basing your API on your current database design means that ...


0

Your module would have to either export the static data or assign it to a global. If the module does nothing, then the data will only be local to the module and will not be reachable from outside. Remember that each module is in it's own function scope so declarations in the module that are not exported and simply local variables within that module ...


0

We use RAML which is a formalized format to describe your REST services using YAML. Example: title: World Music API baseUri: http://example.api.com/{version} version: v1 traits: - paged: queryParameters: pages: description: The number of pages to return type: number - secured: !include ...



Top 50 recent answers are included