/
Fixing links in marketplace

Fixing links in marketplace

The page for https://govstack.gitbook.io/bb-emarketplace/8-service-apis is broken. It renders the text while the promise of the swagger files is resolved, then it throws a NextJS Error: Connection Closed with log t promise callback*t

image-20250123-230003.png
image-20250123-230022.png

tl;dr: Chapter 8 of emarketplace BB is broken, but only in production. This is probably a clogged DOM issue. We should split the chapter into subchapters to solve it. A consolidation of swagger files will be necessary mid-term, and rules about change management to swagger files should be written on the meta-spec.

 

General observations about this issue:

  • Rendering issue only happens on production website. Rendering is correct on Gitbook backoffice

    • Gitbook backoffice appears to use DOM Lazy loading, supporting theory 1

  • The spec is referencing 3 different swagger files. They are all exports of a Swagger documentation hosted in SwaggerHub by Beckn. There’s a general issue of having 4 different versions files of the same API (3 on the Gitbook, plus the slightly different SwaggerHub online version).

Theories:

Theory 1: Too many swagger blocks called. There are 74 in a single page (in comparison Payments BB has only 20 swagger blocks). Rendering too many swagger blocks may be clogging the DOM.

  1. Solution: Divide chapter 8 in subchapters.

  2. Pros: It is too long for a normal web browser to render anyways and even when it does, it is too much info on a single webpage for an end-user. Quick to solve.

  3. Cons: Other BB's do not divide chapter 8. However maybe they should, for legibility.

This is the most likely theory

 

Theory 2: Swagger files referenced are way too large. They contain the full API documentation. In comparison, the Payments BB has one yaml file per endpoint (althought origin / governance is not as clear on these ones, as they don't reference a swaggerhub url). So if this is the problem, and depending on whether the front-end is loading this on-the-fly, it may have trouble generating so many blocks over a large swagger file, so 74 yaml queries to 3 large swagger files, to render each block.

  1. Solution: Break the yml file into many files, one per endpoint.

  2. Pros: Easier to handle changes to the swagger documentation if governance is kept on Gitbook only

  3. Cons: Will decouple what's happening on GitBook and the Swagger app.

 

Other changes that need to be made about the BB

  • 8.8, 8.10, 8.11 No longer there. They were removed on https://govstack-global.atlassian.net/jira/software/c/projects/MKT/list?selectedIssue=MKT-160 however not much explanation about the removal was done. Should contact Steve Conrad and / or Ravi Prakash

  • 8.13.1 appears twice. Needs to be 8.13.12

  • The 4 files involved are different, ever so-slightly, and changes made are poorly documented on GitBook. A consolidation of these files will be necessary but will need to talk to Steve Conrad or whoever is the owner to decide on how to go about the consolidation.

  • The BB is still using the exports from the the swagger app owned by Beck. We may need to own our own swagger tool. See next section

General insights about the Specs procedure

  • About API documentation:

    • We should own a platform (swaggerhub, most likely) to manage and handle changes to guiding API’s

    • We need more control over changes to API procedures. Either we should have a standard procedure to handle exports (resolved vs unresolved) and changes. Or we should point the gitbook swagger blocks to our own GovStack owned swagger instance to avoid duplicity in Gitbook (this would be my preferred way). That would mean the APIs in SwaggerHub would also need to be versioned, mimicking version numbers on GitBook.

  • Deprecation notices should be specified whenever a numeral goes obsolete and a deprecation change log attached

References

The 4 files involved:

Section

File

path

method

Section

File

path

method

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/search

post

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/catalog/{resource}/{id}

get

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/catalog/{resource}/{id}

put

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/catalog/{resource}/{id}

delete

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/catalog/{resource}

post

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/catalog/provider/{providerId}/{resource}/{id}

get

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/catalog/provider/{providerId}/{resource}/{id}

put

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/catalog/provider/{providerId}/{resource}/{id}

delete

8.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/catalog/provider/{providerId}/{resource}

put

8.2

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/search

post

8.2

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/inventory/checkAvailability/{resource}/{id}

get

8.2

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/inventory/item/add

post

8.2

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/inventory/item/remove

post

8.2

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/inventory/item/block

post

8.2

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/inventory/addOn/unblock

post

8.2

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/inventory/addOn/block

post

8.2

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/inventory/item/unblock

post

8.3

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/quotation

post

8.4

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/terms/payment

post

8.4

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/terms/fulfillment

post

8.4

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/terms/cancellation

post

8.5

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/orders

post

8.5

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/orders/{orderId}

get

8.5

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/orders/{orderId}/updatePayment

put

8.5

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/orders/{orderId}/updateFulfillment

put

8.5

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/orders/{orderId}/updateBilling

put

8.5

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/orders/{orderId}/updateItems

put

8.5

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/orders/{orderId}/updateAddOns

put

8.5

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

/orders/{orderId}/cancel

put

8.6

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/fulfillments

post

8.6

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/fulfillments/{fulfillmentId}

get

8.6

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/fulfillments/{fulfillmentId}

put

8.6

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/fulfillments/{fulfillmentId}

delete

8.6

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/fulfillment/checkServiceability

post

8.6

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/fulfillment/{fulfillmentId}/agent/allocate

put

8.6

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/fulfillment/{fulfillmentId}/agent/deallocate

delete

8.7

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/tracking/start

post

8.7

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/tracking/stop

post

8.7

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/tracking/{order_id}/update_location

put

8.9

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/forms

post

8.9

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/forms/{formId}

get

8.9

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/forms/{formId}

put

8.9

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/forms/{formId}

delete

8.9

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/generateFeedbackForRating

post

8.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/support/{orderId}

get

8.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/support/{orderId}

post

8.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/support/{orderId}

put

8.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/support/{orderId}

delete

8.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/support/{orderId}/agent

get

8.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/support/{orderId}/agent

put

8.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-swagger (1).yaml

/support/{orderId}/agent

delete

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/search

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/select

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/init

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/confirm

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/status

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/update

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/track

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/cancel

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/rating

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/support

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/get_rating_categories

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/get_return_reasons

post

8.13.1

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/get_cancellation_reasons

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/on_search

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/on_select

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/on_init

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/on_confirm

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/on_status

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/on_rating

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/on_support

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/rating_categories

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/cancellation_reasons

post

8.13.12

.gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

/return_reasons

post

 

used in: 8.1, 8.2 and 8.13.11

  • 8.1 and 8.2: .gitbook/assets/beckn-e-marketplace-bb-0.2-swagger.yaml

  • 8.13.11: .gitbook/assets/beckn-e-marketplace-bb-0.2-resolved (2).yaml

One is resolved and the second unresolved. The better one looks to be the resolved one

tags: - Order Lifecycle API (requests)

responses.default.content.application/json.schema.ref: #/components/schemas/inline_response_default_5

Current swagger

/search: post: tags: - Order Lifecycle API (requests) description: Consumer Interface declares the customer's intent to buy/avail products or services requestBody: content: application/json: schema: $ref: '#/components/schemas/search_body' responses: default: description: Acknowledgement of message received after successful validation of schema and signature content: application/json: schema: $ref: '#/components/schemas/inline_response_default_5'
inline_response_default_5: required: - message type: object properties: message: $ref: '#/components/schemas/inline_response_default_5_message' error: $ref: '#/components/schemas/Error'

Reference: https://support.smartbear.com/swaggerhub/docs/en/manage-apis/download-api-definitions-from-swaggerhub.html

Feature

Unresolved Export

Resolved Export

Feature

Unresolved Export

Resolved Export

References ($ref)

Retained

Replaced with actual definitions

Size

Smaller, more modular

Larger, fully expanded

Use Case

Tools that can resolve $ref

Environments that cannot handle $ref

If you're exporting or sharing a Swagger file, consider the needs of the target system or audience. For example:

  • Use unresolved for development and collaboration.

  • Use resolved for deployment to systems with limited Swagger or OpenAPI support.

Related content

Review of Payments BB API documentation
Review of Payments BB API documentation
More like this
Review of Consent BB API documentation
Review of Consent BB API documentation
More like this
October 26, 2023 Technical Committee Meeting Note
October 26, 2023 Technical Committee Meeting Note
More like this
Documenting API Changes
Documenting API Changes
More like this
2023-10-09 - Work meeting
2023-10-09 - Work meeting
More like this
Review of Identity BB API documentation
Review of Identity BB API documentation
More like this