Skip to content

Commit

Permalink
fix(proto): update the generated proto to adhere to the (#14)
Browse files Browse the repository at this point in the history
API linter.

Known issues, that will require further discussion:

- file_path: bookstore.yaml.output.proto
  problems:
    - message: Custom methods should use the HTTP POST or GET method.
      location:
        start_position:
          line_number: 80
          column_number: 5
        end_position:
          line_number: 80
          column_number: 76
        path: bookstore.yaml.output.proto
      rule_id: core::0136::http-method
      rule_doc_uri: https://linter.aip.dev/136/http-method
    - message: 'Custom POST methods should set `body: "*"`.'
      location:
        start_position:
          line_number: 80
          column_number: 5
        end_position:
          line_number: 80
          column_number: 76
        path: bookstore.yaml.output.proto
      rule_id: core::0136::http-body
      rule_doc_uri: https://linter.aip.dev/136/http-body
    - message: The `parent` field should include a `google.api.resource_reference` annotation.
      location:
        start_position:
          line_number: 42
          column_number: 3
        end_position:
          line_number: 42
          column_number: 20
        path: bookstore.yaml.output.proto
      rule_id: core::0132::request-parent-reference
      rule_doc_uri: https://linter.aip.dev/132/request-parent-reference
- message: HTTP URI should include a `book.path` variable.
  location:
    start_position:
      line_number: 65
      column_number: 5
    end_position:
      line_number: 68
      column_number: 6
    path: bookstore.yaml.output.proto
  rule_id: core::0134::http-uri-path
  rule_doc_uri: https://linter.aip.dev/134/http-uri-path
- message:
    'Unexpected field: Update RPCs must only contain fields explicitly described
    in AEPs, not "path".'
  location:
    start_position:
      line_number: 32
      column_number: 3
    end_position:
      line_number: 32
      column_number: 18
    path: bookstore.yaml.output.proto
  rule_id: core::0134::request-unknown-fields
  rule_doc_uri: https://linter.aip.dev/134/request-unknown-fields
- message: List responses should only contain fields explicitly described in AEPs.
  location:
    start_position:
      line_number: 46
      column_number: 3
    end_position:
      line_number: 46
      column_number: 30
    path: bookstore.yaml.output.proto
  rule_id: core::0132::response-unknown-fields
  rule_doc_uri: https://linter.aip.dev/132/response-unknown-fields
---
- message: The filename has invalid characters.
  location:
    start_position:
      line_number: 9
      column_number: 1
    end_position:
      line_number: 9
      column_number: 26
    path: bookstore.yaml.output.proto
  rule_id: core::0191::filenames
  rule_doc_uri: https://linter.aip.dev/191/filenames
  • Loading branch information
toumorokoshi authored Aug 17, 2024
1 parent 125b45c commit 86ef13e
Show file tree
Hide file tree
Showing 11 changed files with 718 additions and 308 deletions.
10 changes: 8 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,22 @@ Install go.

Install protoc-gen-go:

```
```bash
go install google.golang.org/protobuf/cmd/[email protected]
```

Install buf:

```
```bash
go install github.com/bufbuild/buf/cmd/[email protected]
```

Install the aepc fork of the api-linter:

```bash
go install github.com/aep-dev/api-linter/cmd/api-linter@latest
```

## Building aepc

The standard GoLang toolchain is used, with the addition of protobuf for
Expand Down
23 changes: 18 additions & 5 deletions constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,21 @@
// limitations under the License.
package constants

const FIELD_NAME_PARENT = "parent"
const FIELD_NAME_PATH = "path"
const FIELD_NAME_RESOURCE = "resource"
const FIELD_NAME_RESOURCES = "resources"
const FIELD_NAME_ID = "id"
const FIELD_PARENT_NAME = "parent"
const FIELD_PARENT_NUMBER = 10013
const FIELD_PATH_NAME = "path"
const FIELD_PATH_NUMBER = 10018
const FIELD_RESOURCE_NAME = "resource"
const FIELD_RESOURCE_NUMBER = 10015
const FIELD_RESOURCES_NAME = "resources"
const FIELD_RESOURCES_NUMBER = 10016
const FIELD_PAGE_TOKEN_NAME = "page_token"
const FIELD_PAGE_TOKEN_NUMBER = 10010
const FIELD_UPDATE_MASK_NAME = "update_mask"
const FIELD_UPDATE_MASK_NUMBER = 10012
const FIELD_MAX_PAGE_SIZE_NAME = "max_page_size"
const FIELD_MAX_PAGE_SIZE_NUMBER = 10017
const FIELD_NEXT_PAGE_TOKEN_NAME = "next_page_token"
const FIELD_NEXT_PAGE_TOKEN_NUMBER = 10011
const FIELD_ID_NAME = "id"
const FIELD_ID_NUMBER = 10014
348 changes: 226 additions & 122 deletions example/bookstore/bookstore.yaml.output.pb.go

Large diffs are not rendered by default.

84 changes: 49 additions & 35 deletions example/bookstore/bookstore.yaml.output.pb.gw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 86ef13e

Please sign in to comment.