Skip to content

Conversation

@STRML
Copy link
Member

@STRML STRML commented Oct 24, 2017

Description

Adds a documented parameter to 'accepts' - good for deprecating old parameters. parameterDeprecated is a thing in OpenAPI 3.0 (https://github.com/OAI/OpenAPI-Specification/pull/637/files) but not in 2.0, so this works well in the meantime and may have other uses even when we get to 3.0.

Example
{
  accepts: [
    {arg: 'id', type: 'string'},
    {arg: 'undocumented', type: 'string', documented: false},
  ],
}

Related issues

None

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

@STRML STRML requested review from bajtos and zbarbuto as code owners October 24, 2017 18:44
@STRML STRML force-pushed the feature/accepts-documented branch from 2227958 to 4cae1cd Compare October 24, 2017 18:45
Copy link
Member

@zbarbuto zbarbuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good Idea. Would also love to see the same for endpoints as well as arguments but obviously that can be a separate PR.

@STRML
Copy link
Member Author

STRML commented Oct 24, 2017

It already is:

if (!route.documented) return;

@zbarbuto
Copy link
Member

Ah, right you are... not sure why I thought it didn't exist - must have been thinking of something else

https://github.com/strongloop/strong-remoting/blob/master/lib/rest-adapter.js#L570

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

This is great, thank you for the contribution!

@bajtos
Copy link
Member

bajtos commented Oct 26, 2017

@slnode ok to test

@bajtos
Copy link
Member

bajtos commented Oct 26, 2017

@STRML could you please update our documentation to mention this new flag too? Here is the page to update: _includes/content/rm-options.md and here are the instructions for contributing to our docs: http://loopback.io/doc/en/contrib/doc-contrib.html

@bajtos bajtos self-assigned this Oct 26, 2017
STRML added a commit to STRML/loopback.io that referenced this pull request Oct 26, 2017
Add `documented` options for both method & accepts definition.

Related: strongloop/loopback-swagger#107
@STRML
Copy link
Member Author

STRML commented Oct 26, 2017

crandmck pushed a commit to loopbackio/loopback.io that referenced this pull request Oct 26, 2017
* Update rm-options.md

Add `documented` options for both method & accepts definition.

Related: strongloop/loopback-swagger#107

* Note OpenAPI/Swagger
@bajtos bajtos merged commit 29ae0f0 into strongloop:master Oct 27, 2017
@bajtos
Copy link
Member

bajtos commented Oct 27, 2017

Awesome, thank you for the doc contribution too!

I have landed the patch and released it in [email protected].

Enjoy 😄

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants