Skip to content

Response descriptions  #66

Closed

Description

@jonthegeek

Summary

As the maintainer of an API-wrapping package, in order to inform users about the information returned by an endpoint, I would like to utilize the response description from the OpenAPI definition for that endpoint.

Details

.path_row_to_list() in R/generate_pkg_paths.R includes response_description in the returned list, but we do not currently use it. Also, we set it to "" by default.

Update inst/templates/paths.R, currently line 12:

#' @returns `{{fn_prefix}}{{operation_id}}()`: The API response.

Instead of the generic "The API response", use "{{response_description}}`.

Use "The API response." as the default value of {{response_description}}. Also use the default if the value extracted from the spec resolves to character() or "" (see the %|a|% utility in R/utils.R, and use description %|a|% "The API response.").

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions