8000 Support line comments on request & response fields by DomBlack · Pull Request #161 · encoredev/encore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support line comments on request & response fields #161

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

Merged
merged 1 commit into from
Apr 1, 2022

Conversation

DomBlack
Copy link
Contributor
@DomBlack DomBlack commented Apr 1, 2022

This commit adds support for line based comments on struct fields and
Encore will now pick those up if there is not a doc comment on the field

type FooBar struct {
    // This is a doc comment on Field
    Field string

    // This doc comment will take presendence over the line comment
    Foo string // This is a line comment will be ignored

    Bar string // This is a line comment will be used as the documentation
}

This example will result in the following documentation generation:

Field: This is a doc comment on Field
Foo: This doc comment will take presendence over the line comment
Bar: This is a line comment will be used as the documentation

This commit adds support for line based comments on struct fields and
Encore will now pick those up if there is not a doc comment on the field

```go
type FooBar struct {
    // This is a doc comment on Field
    Field string

    // This doc comment will take presendence over the line comment
    Foo string // This is a line comment will be ignored

    Bar string // This is a line comment will be used as the documentation
}
```

This example will result in the following documentation generation:

> `Field`: This is a doc comment on Field
> `Foo`: This doc comment will take presendence over the line comment
> `Bar`: This is a line comment will be used as the documentation
@encore-cla
Copy link
encore-cla bot commented Apr 1, 2022

All committers have signed the CLA.

@DomBlack DomBlack requested a review from eandre April 1, 2022 13:51
@DomBlack DomBlack added the enhancement New feature or request label Apr 1, 2022
@DomBlack DomBlack merged commit 5c5746a into main Apr 1, 2022
@DomBlack DomBlack deleted the ENC-423-SupportLineCommentDocs branch April 1, 2022 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0