carbon-io / carbond

MIT License
2 stars 5 forks source link

Document noDocument config #201

Open rmiyashiro opened 7 years ago

rmiyashiro commented 7 years ago

You can now add a noDocument flag to your Endpoint, operation, or parameter config to exclude it from the generated documentation. For example:

o({
  _type: carbon.carbond.collections.Collection,
  noDocument: true, // exclude the whole endpoint
  insertConfig: {
    description: "Secret operation",
    noDocument: true // exclude operation
  },
  findConfig: {
    parameters: {
      secretParam: {
        description: "Top secret parameter",
        location: "query",
        schema: {type: 'string'},
        noDocument: true // exclude parameter
      }
    }
  }
})

(the noDocument flags within the operation and parameter are redundant since the whole endpoint is excluded, but you get the idea)

Also, this flag can be overridden at runtime by passing the --include-undocumented flag to gen-static-docs.