Skip to content

Conversation

@HenrikHL
Copy link
Contributor

@HenrikHL HenrikHL commented Nov 26, 2025

User description

SD-1936: Update examples to be more specific and NOT autogenerated by e.g. SwaggerHub


PR Type

Enhancement, Documentation


Description

  • Add comprehensive request/response examples to PINT, Issuance, and Surrender API specs

  • Include realistic Transport Document example with full cargo and party details

  • Add error response examples for various HTTP status codes and scenarios

  • Provide rejection example for Issuance Response with unknown party scenario


Diagram Walkthrough

flowchart LR
  A["OpenAPI Specs"] -->|Add Request Examples| B["PINT v3.0.0"]
  A -->|Add Request Examples| C["Issuance v3.0.3"]
  A -->|Add Request Examples| D["Surrender v3.0.3"]
  B -->|Include Success & Error| E["Response Examples"]
  C -->|Include Success & Error| E
  D -->|Include Success & Error| E
  E -->|Realistic Data| F["Non-autogenerated Examples"]
Loading

File Walkthrough

Relevant files
Documentation
EBL_PINT_v3.0.0.yaml
Add request and error response examples to PINT API           

pint/v3/EBL_PINT_v3.0.0.yaml

  • Add regularSTDExample with complete Transport Document request payload
    including shipper, carrier, charges, and equipment details
  • Add error response examples for POST /v3/envelopes endpoint with 500
    status code
  • Add error response examples for PUT
    /v3/envelopes/{envelopeReference}/additional-documents/{documentChecksum}
    endpoint
  • Add error response examples for PUT
    /v3/envelopes/{envelopeReference}/finish-transfer endpoint
  • Add error response examples for POST /v3/receiver-validation endpoint
    with both 404 (unknown party) and 500 (internal error) scenarios
+216/-0 
EBL_ISS_v3.0.3.yaml
Add request and response examples to Issuance API               

ebl/v3/issuance/EBL_ISS_v3.0.3.yaml

  • Add regularSTDExample with complete Issuance Request including
    document details, party information, and carrier visualization
  • Add rejectedExample showing rejection response when IssueTo party is
    unknown on receiving platform
  • Add error response examples for PUT /v3/ebl-issuance-requests endpoint
    with 500 status code
  • Add error response examples for POST /v3/ebl-issuance-responses
    endpoint with 500 status code
+175/-0 
EBL_SUR_v3.0.3.yaml
Add request and error response examples to Surrender API 

ebl/v3/surrender/EBL_SUR_v3.0.3.yaml

  • Add surrenderExample with complete Surrender Request including
    endorsement chain with action history and party details
  • Add error response examples for POST /v3/ebl-surrender-requests
    endpoint with 500 status code
  • Add error response examples for POST /v3/ebl-surrender-responses
    endpoint with 500 status code
+77/-0   
Configuration changes
styleguide.json
Update styleguide configuration                                                   

.stoplight/styleguide.json

  • Minor configuration changes to styleguide
+1/-1     

@qodo-code-review
Copy link

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Token misuse risk

Description: The example embeds long JWT-like strings for envelopeManifestSignedContent and
envelopeTransferChain that could be mistaken for live tokens if copied to non-example
contexts; ensure they are clearly non-functional and sanitized across all examples.
EBL_PINT_v3.0.0.yaml [206-208]

Referred Code
envelopeManifestSignedContent: eyJhbGciOiJSUzI1NiIsImtpZCI6IlVhRVdLNmt2ZkRITzNZT2NwUGl2M1RCT2JQTzk2SFZhR2U0czFhUUxBZU0ifQ.eyJ0cmFuc3BvcnREb2N1bWVudENoZWNrc3VtIjogIjU4M2MyOWFiM2U0N2YyZDgwODk5OTkzMjAwZDNmYmFkYjlmOGEzNjdmM2EzOWY3MTU5MzVjNDZkN2EyODMwMDYiLCJsYXN0RW52ZWxvcGVUcmFuc2ZlckNoYWluRW50cnlTaWduZWRDb250ZW50Q2hlY2tzdW0iOiAiMjBhMDI1N2IzMTNhZTA4NDE3ZTA3ZjY1NTVjNGVjODI5YTUxMmMwODNmM2VhZDE2YjQxMTU4MDE4YTIyYWJlOSJ9.c4SJ9-61fE6RmeIuZ3EI-TSM0M6qXuOudtr3YhpDjqVMaYk_RYpaWYvw75ssTbjgGFKTBKCy5lpmOfb8Fq--Qu2k0MWbH6qdX5jTYwl0DX946RQg-hnmVTg9np3bmqVeKqKURyV-UUdG-KK_XCGzPZ-lZkeUlpMcIthQFs0pCODR9GPytv7ZXLPZFOmHM9fn3FD2yRqVhQzcs7HdcxMjCx6hkBW8Z-jW4qteVy2_E9uqjkKwlu_cQLoY83Z0mcjn0PZNQvKF10x7q1_Jjf_Su19UigTUu3pFMrzo4iPS_jcrFo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ZNQvKF10x7q1_Jjf_Su19UigTUu3pFMrzo4iPS_jcrFoIb3TSZNSzbgAwtujSBFOufPDyEmxlx1sH0ZowMvA
Example payload reuse

Description: An embedded base64 PDF blob and JWT-like example value may be large and could be reused
inadvertently; confirm these are harmless placeholders and not sensitive or licensed
content.
EBL_ISS_v3.0.3.yaml [186-189]

Referred Code
              content: iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAGaSURBVDhPnZO/S0JRFMe/zygxwgqcfZtz0N7SFNgPaKlJpTFLCqwotV9qRYN/gIOL1FK22NISWENT0BTUkNLgIL2iHxYRnc697/kKzdA+cOD8uOec77uXB/oHngMPnd2eSb/pAf5DP2EWhGlQ8ChIikiiQa7vruFacwHdHHwC9nY7mhqgRBTdsbDdA/nVvHQbYnxvHHhnp4XtFZjon4DapTam4Lx4jt7NXlO6WEsreltDA5RFlt4qHDaWXlgrwNnplDX5CcWnIo5vjmWimsGdQV7HjjjJ0gMDAbNZopU1wgwfmQSlL9JCkEkunyMEuLbMFgZZ161G5RsFES5WNrC8lC8Fb49XDlcWWLNVOHqttFGCo90haxUsyeEk8GhEfEm+lA/ZqyyGdof0ocJegMhIpKZZIC8xfhLH0v6SfstCzRubeK42tg9Od3RDm9c4qMV8hWguinAmDHTJvC5bVB6A8nYZtlabTFcjX0EQ6gshNhqTDSbPQGIsUbdZIhT8ZOt0izDFu+dAakI1svX59W/MXGbIveM2or8g+gL+Fn3DwcYf+gAAAABJRU5ErkJggg==
              contentType: application/pdf
            issuanceManifestSignedContent: eyJhbGciOiJSUzI1NiIsImtpZCI6IlVhRVdLNmt2ZkRITzNZT2NwUGl2M1RCT2JQTzk2SFZhR2U0czFhUUxBZU0ifQ.eyJkb2N1bWVudENoZWNrc3VtIjogIjhkYzk5ZDhhYzkyMjI0MGM1NWMwMzg0NWY0OWRlZjY0MTg3MTQ2NjUxYmFlNGY5YTYzMTMxMjc3Y2YwMGQ5ZGYiLCJlQkxWaXN1YWxpc2F0aW9uQnlDYXJyaWVyQ2hlY2tzdW0iOiAiNzZhN2QxNGM4M2Q3MjY4ZDY0M2FlNzM0NWM0NDhkZTYwNzAxZjk1NWQyNjRhNzQzZTY5MjhhMGI4MjY4YjI0ZiIsImlzc3VlVG9DaGVja3N1bSI6ICI3NmE3ZDE0YzgzZDcyNjhkNjQzYWU3MzQ1YzQ0OGRlNjA3MDFmOTU1ZDI2NGE3NDNlNjkyOGEwYjgyNjhiMjRmIn0.c4SJ9-61fE6RmeIuZ3EI-TSM0M6qXuOudtr3YhpDjqVMaYk_RYpaWYvw75ssTbjgGFKTBKCy5lpmOfb8Fq--Qu2k0MWbH6qdX5jTYwl0DX946RQg-hnmVTg9np3bmqVeKqKURyV-UUdG-KK_XCGzPZ-lZkeUlpMcIthQFs0pCODR9GPytv7ZXLPZFOmHM9fn3FD2yRqVhQzcs7HdcxMjCx6hkBW8Z-jW4qteVy2_E9uqjkKwlu_cQLoY83Z0mcjn0PZNQvKF10x7q1_Jjf_Su19UigTUu3pFMrzo4iPS_jcrFoIb3TSZNSzbgAwtujSBFOufPDyEmxlx1sH0ZowMvA
responses:
Ticket Compliance
🟡
🎫 #SD-1936
🔴 Replace autogenerated SwaggerHub examples with specialized, accurate examples for all
relevant endpoints in PINT API so conditional requirements are respected (e.g., not
showing both consignee and endorsee simultaneously).
Provide specialized examples for all relevant endpoints in ISS API.
Provide specialized examples for all relevant endpoints in SUR API.
Include realistic request/response examples, including error scenarios, across PINT, ISS,
and SUR.
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status:
Audit relevance unclear: The PR adds OpenAPI examples only and does not include runtime logic for logging critical
actions, so audit trail compliance cannot be determined from the diff.

Referred Code
application/json:
  schema:
    $ref: '#/components/schemas/EblEnvelope'
  examples:
    regularSTDExample:
      summary: |
        Endorsing a Transport Document with regular Dry cargo
      description: |
        A **Transport Document** being sent.

        **Note:** The `envelopeManifestSignedContent` and `envelopeTransferChain` are not computed values but rather random strings (this example cannot be used as is).
      value:
        transportDocument:
          transportDocumentReference: 62CD536BA8D34C469AFD
          shippingInstructionsReference: fc5009a7-25ad-4bb0-9892-4e2dea6bcdd9
          transportDocumentStatus: DRAFT
          transportDocumentTypeCode: BOL
          isShippedOnBoardType: true
          freightPaymentTermCode: PRE
          isElectronic: true
          isToOrder: true


 ... (clipped 471 lines)

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Example-only errors: The PR adds structured error response examples but does not show actual error handling
logic or validation paths, so robustness cannot be verified from the diff.

Referred Code
application/json:
  schema:
    $ref: '#/components/schemas/ErrorResponse'
  examples:
    errorExample:
      summary: |
        Internal Error
      description: |
        An Internal error occurred.

        **NB**: The `errorCode` is not yet standardized by DCSA. The value `7003` is just a "random example".
      value:
        httpMethod: PUT
        requestUri: /v3/ebl-issuance-requests
        statusCode: 500
        statusCodeText: Internal Error
        statusCodeMessage: Internal Error
        providerCorrelationReference: 4426d965-0dd8-4005-8c63-dc68b01c4962
        errorDateTime: '2025-11-26T09:41:00Z'
        errors:
          - errorCode: 7003


 ... (clipped 77 lines)

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status:
Logging not shown: The diff only adds API examples and does not demonstrate logging behavior, so secure
logging practices cannot be assessed.

Referred Code
application/json:
  schema:
    $ref: '#/components/schemas/ErrorResponse'
  examples:
    errorExample:
      summary: |
        Internal Error
      description: |
        An Internal error occurred.

        **NB**: The `errorCode` is not yet standardized by DCSA. The value `7003` is just a "random example".
      value:
        httpMethod: POST
        requestUri: /v3/ebl-surrender-requests
        statusCode: 500
        statusCodeText: Internal Error
        statusCodeMessage: Internal Error
        providerCorrelationReference: 4426d965-0dd8-4005-8c63-dc68b01c4962
        errorDateTime: '2025-11-26T09:41:00Z'
        errors:
          - errorCode: 7003


 ... (clipped 54 lines)

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status:
Validation unspecified: The PR defines request/response examples but does not include input validation or auth
controls, making security posture unverifiable from the diff.

Referred Code
application/json:
  schema:
    $ref: '#/components/schemas/EblEnvelope'
  examples:
    regularSTDExample:
      summary: |
        Endorsing a Transport Document with regular Dry cargo
      description: |
        A **Transport Document** being sent.

        **Note:** The `envelopeManifestSignedContent` and `envelopeTransferChain` are not computed values but rather random strings (this example cannot be used as is).
      value:
        transportDocument:
          transportDocumentReference: 62CD536BA8D34C469AFD
          shippingInstructionsReference: fc5009a7-25ad-4bb0-9892-4e2dea6bcdd9
          transportDocumentStatus: DRAFT
          transportDocumentTypeCode: BOL
          isShippedOnBoardType: true
          freightPaymentTermCode: PRE
          isElectronic: true
          isToOrder: true


 ... (clipped 471 lines)

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Use reusable components for API examples

To improve maintainability, define large, duplicated API examples (like
transport documents and error responses) as reusable components in the
components/examples section. Then, reference them using $ref in the API
endpoints instead of defining them inline.

Examples:

pint/v3/EBL_PINT_v3.0.0.yaml [93-208]
            examples:
              regularSTDExample:
                summary: |
                  Endorsing a Transport Document with regular Dry cargo
                description: |
                  A **Transport Document** being sent.
                  
                  **Note:** The `envelopeManifestSignedContent` and `envelopeTransferChain` are not computed values but rather random strings (this example cannot be used as is).
                value:
                  transportDocument:

 ... (clipped 106 lines)
ebl/v3/issuance/EBL_ISS_v3.0.3.yaml [65-188]
            examples:
              regularSTDExample:
                summary: |
                  Issuing a Transport Document with regular Dry cargo
                description: |
                  A **Transport Document** being issued.
                  
                  **Note:** The `content` in the `eBLVisualisationByCarrier` and `issuanceManifestSignedContent` are not "real" values but rather random strings (this example cannot be used as is).
                value:
                  document:

 ... (clipped 114 lines)

Solution Walkthrough:

Before:

# In pint/v3/EBL_PINT_v3.0.0.yaml
paths:
  /v3/envelopes:
    post:
      requestBody:
        content:
          application/json:
            examples:
              regularSTDExample:
                summary: Endorsing a Transport Document...
                value:
                  transportDocument:
                    transportDocumentReference: 62CD536BA8D34C469AFD
                    # ... many lines of duplicated example data
      responses:
        '500':
          content:
            application/json:
              examples:
                errorExample:
                  value:
                    # ... duplicated error response fields

After:

# In a shared file or within each file's components section
components:
  examples:
    transportDocumentExample:
      summary: Endorsing a Transport Document...
      value:
        transportDocument:
          transportDocumentReference: 62CD536BA8D34C469AFD
          # ... many lines of example data defined once
    internalErrorExample:
      value:
        # ... generic error response fields defined once

# In pint/v3/EBL_PINT_v3.0.0.yaml
paths:
  /v3/envelopes:
    post:
      requestBody:
        content:
          application/json:
            examples:
              regularSTDExample:
                $ref: '#/components/examples/transportDocumentExample'
      responses:
        '500':
          content:
            application/json:
              examples:
                errorExample:
                  $ref: '#/components/examples/internalErrorExample'
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies significant duplication of large example objects across multiple files and proposes using reusable components, which is a standard OpenAPI best practice that greatly improves maintainability.

Medium
General
Fix grammatical error in example

Correct a grammatical error in the termsAndConditions example text from "exist
is name only" to "exists in name only".

pint/v3/EBL_PINT_v3.0.0.yaml [112-134]

 termsAndConditions: |
-  You agree that this transport document exist is name only for the sake of
+  You agree that this transport document exists in name only for the sake of
   testing your conformance with the DCSA eBL API. This transport document is NOT backed
   by a real shipment with ANY carrier and NONE of the requested services will be
   carried out in real life.
 
   Unless required by applicable law or agreed to in writing, DCSA provides
   this JSON data on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
   ANY KIND, either express or implied, including, without limitation, any
   warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY,
   or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for
   determining the appropriateness of using or redistributing this JSON
   data and assume any risks associated with Your usage of this data.
 
   In no event and under no legal theory, whether in tort (including negligence),
   contract, or otherwise, unless required by applicable law (such as deliberate
   and grossly negligent acts) or agreed to in writing, shall DCSA be liable to
   You for damages, including any direct, indirect, special, incidental, or
   consequential damages of any character arising as a result of this terms or conditions
   or out of the use or inability to use the provided JSON data (including but not limited
   to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any
   and all other commercial damages or losses), even if DCSA has been advised of the
   possibility of such damages.
  • Apply / Chat
Suggestion importance[1-10]: 2

__

Why: The suggestion correctly identifies a grammatical error in a text block within an example, and the fix improves clarity and professionalism.

Low
  • More

@HenrikHL HenrikHL merged commit d08d652 into master Nov 27, 2025
1 check passed
@HenrikHL HenrikHL deleted the SD-1936_Update-examples branch November 27, 2025 08:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants