Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not duplicate parameter's description when there is an example, and inline the example. #1678

Closed
wants to merge 3 commits into from

Conversation

foriequal0
Copy link

@foriequal0 foriequal0 commented May 25, 2020

Previous PRs: #1552, #1629

<param name="foo" example="baz">foo parameter</param>
public void Get(string foo) {}

Before:

          {
            "name": "foo",
            "in": "path",
            "description": "foo parameter",
            "schema": {
              "type": "string",
              "description": "foo parameter",
              "example": "baz"
            }
          }

After removing duplication:

          {
            "name": "foo",
            "in": "path",
            "description": "foo parameter",
            "schema": {
              "type": "string",
              "example": "baz"
            }
          }

After moving examples under its parameters:

          {
            "name": "foo",
            "in": "path",
            "description": "foo parameter",
            "example": "baz",
            "schema": {
              "type": "string"
            }
          }

@foriequal0 foriequal0 changed the title Do not duplicate parameter's description when there is example, and inline example. Do not duplicate parameter's description when there is an example, and inline example. May 25, 2020
@foriequal0 foriequal0 changed the title Do not duplicate parameter's description when there is an example, and inline example. Do not duplicate parameter's description when there is an example, and inline the example. May 25, 2020
Parameter's descriptions are already included by
`XmlCommentsParameterFilter`.
}
}

private static IOpenApiAny ConvertToOpenApiType(Type memberType, OpenApiSchema schema, string stringValue)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe you shouldn't duplicate this method and move it somewhere so it can be used here and in XmlCommentsSchemaFilter.

@domaindrivendev
Copy link
Owner

I believe the underlying bug has since been resolved by some refactors to the Xml comments filters and so this PR is no longer neccessary. I'm not sure if these changes are present in the lastest stable release but they will be in the latest preview release available on myget.org.

@foriequal0 if you get a chance, please try out the preview package and let me know if the duplication is in fact resolved. If it's not we'll need to create a new issue and subsequent PR. Thx

@foriequal0 foriequal0 deleted the inline-example branch January 11, 2021 05:22
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