Skip to content

Commit

Permalink
fix: add missing swagger type annotations for BFF endpoints (#314)
Browse files Browse the repository at this point in the history
# What ❔

Add missing swagger type annotations for BFF endpoints.

## Why ❔

Auto code generators that work based on the Swagger docs rely on the
specified Swagger type, and if it's missing, they assume the parameter
is of the object type.

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [X] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
  • Loading branch information
vasyl-ivanchuk authored Nov 11, 2024
1 parent ad1dc14 commit 75fcd21
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/app-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: BE App E2E tests

on:
workflow_call:
secrets:
ALLURE_TOKEN:
description: 'A token passed from the caller workflow'
required: true
# secrets:
# ALLURE_TOKEN:
# description: 'A token passed from the caller workflow'
# required: true
inputs:
environmentTags:
type: string
Expand Down
3 changes: 3 additions & 0 deletions packages/api/src/address/address.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export class AddressController {
@Get(":address")
@ApiParam({
name: "address",
type: String,
schema: { pattern: ADDRESS_REGEX_PATTERN },
example: constants.address,
description: "Valid hex address",
Expand Down Expand Up @@ -106,6 +107,7 @@ export class AddressController {
@Get(":address/logs")
@ApiParam({
name: "address",
type: String,
schema: { pattern: ADDRESS_REGEX_PATTERN },
example: constants.contractAddressWithLogs,
description: "Valid hex address",
Expand All @@ -130,6 +132,7 @@ export class AddressController {
@Get(":address/transfers")
@ApiParam({
name: "address",
type: String,
schema: { pattern: ADDRESS_REGEX_PATTERN },
example: constants.address,
description: "Valid hex address",
Expand Down
2 changes: 2 additions & 0 deletions packages/api/src/token/token.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class TokenController {
@Get(":address")
@ApiParam({
name: "address",
type: String,
schema: { pattern: ADDRESS_REGEX_PATTERN },
example: constants.tokenAddress,
description: "Valid hex address",
Expand All @@ -75,6 +76,7 @@ export class TokenController {
@Get(":address/transfers")
@ApiParam({
name: "address",
type: String,
schema: { pattern: ADDRESS_REGEX_PATTERN },
example: constants.tokenAddress,
description: "Valid hex address",
Expand Down
3 changes: 3 additions & 0 deletions packages/api/src/transaction/transaction.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class TransactionController {
@Get(":transactionHash")
@ApiParam({
name: "transactionHash",
type: String,
schema: { pattern: TX_HASH_REGEX_PATTERN },
example: constants.txHash,
description: "Valid transaction hash",
Expand All @@ -84,6 +85,7 @@ export class TransactionController {
@Get(":transactionHash/transfers")
@ApiParam({
name: "transactionHash",
type: String,
schema: { pattern: TX_HASH_REGEX_PATTERN },
example: constants.txHash,
description: "Valid transaction hash",
Expand Down Expand Up @@ -114,6 +116,7 @@ export class TransactionController {
@Get(":transactionHash/logs")
@ApiParam({
name: "transactionHash",
type: String,
schema: { pattern: TX_HASH_REGEX_PATTERN },
example: constants.txHash,
description: "Valid transaction hash",
Expand Down

0 comments on commit 75fcd21

Please sign in to comment.