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

style: fix OpenAPI spec linter warnings in endpoints #1126

Closed
petermetz opened this issue Jul 13, 2021 · 2 comments · Fixed by #1145
Closed

style: fix OpenAPI spec linter warnings in endpoints #1126

petermetz opened this issue Jul 13, 2021 · 2 comments · Fixed by #1145
Assignees
Labels
Developer_Experience good-first-issue Good for newcomers good-first-issue-100-introductory Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label.

Comments

@petermetz
Copy link
Member

Description

We have linter warnings about the endpoint classes having methods that do not declare their return types.
The workaround can be seen below that will declare explicitly the return type without having to construct any additional new types to map to the JSON files (open API specs)

  public get oasPath(): typeof OAS.paths["/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction"] {
    return OAS.paths[
      "/api/v1/plugins/@hyperledger/cactus-plugin-ledger-connector-fabric/run-transaction"
    ];
  }

  public getPath(): string {
    return this.oasPath.post["x-hyperledger-cactus"].http.path;
  }

  public getVerbLowerCase(): string {
    return this.oasPath.post["x-hyperledger-cactus"].http.verbLowerCase;
  }

  public getOperationId(): string {
    return this.oasPath.post.operationId;
  }

Acceptance Criteria

  1. All linter warnings in the project that are about the OAS path objects in the endpoint classes' methods are fixed (no need to fix all linter warnings just the relevant ones)

cc: @ty-lazar @Jeff-Ushry @twiggins120 @awadhana @Leeyoungone

@petermetz petermetz added good-first-issue Good for newcomers Developer_Experience Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label. good-first-issue-100-introductory labels Jul 13, 2021
@Leeyoungone
Copy link
Contributor

May I take this one?

@petermetz
Copy link
Member Author

May I take this one?

@Leeyoungone Yup, all yours! :-)

Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Jul 16, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
petermetz pushed a commit to Leeyoungone/cactus that referenced this issue Jul 16, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Jul 26, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Jul 26, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Jul 26, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Jul 27, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Jul 28, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Jul 30, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Leeyoungone added a commit to Leeyoungone/cactus that referenced this issue Aug 6, 2021
Fixes hyperledger#1126

Signed-off-by: Youngone Lee <youngone.lee@accenture.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer_Experience good-first-issue Good for newcomers good-first-issue-100-introductory Hacktoberfest Hacktoberfest participants are welcome to take a stab at issues marked with this label.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants