You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_1 (already cloned)
- Base commit: 61c2e2c75fabdb03c5599df97240a030cb7b5b6a
- Task ID: juspay__hyperswitch-8332
- Version: v1.114.0
TASK DESCRIPTION: Bug: docs(openapi): Show API version selection dropdown in API Reference
Add a version selection dropdown in API reference to allow exploring v2 APIs
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
- Moved both
v1andv2API docs underapi-referencedirectory - Renamed
openapi_spec.jsonfiles for v1 and v2 - Updated OpenAPI spec file paths in
openapicrate - Modified OpenAPI spec path in CI pipeline
Additional Changes
- This PR modifies the API contract
- This PR modifies the database schema
- This PR modifies application configuration/environment variables
Motivation and Context
Closes #8332
How did you test it?
Executed:
cargo run -p openapi --features v1and verified
openapi_spec_v1.jsongeneratedHow the version dropdown looks like:
Checklist
- I formatted the code
cargo +nightly fmt --all - I addressed lints thrown by
Assistant
I need to understand the task better. The issue is about adding an API version selection dropdown in the API Reference documentation. Let me first explore the repository structure to understand where the API reference and OpenAPI specs are located.
Assistant
Let me explore the repository structure to understand where the API reference and OpenAPI specifications are located.
Assistant
(no content)
Assistant
Let me look at the current API reference documentation files to understand how it's structured:
Assistant
Let me also check the v2 API reference files:
Assistant
Let me look at the docs.json file to understand the current documentation structure:
Assistant
Now I need to check the Mintlify configuration to understand how to add version selection. Let me also examine the v2 docs.json to compare:
Assistant
Now let me check if there are any references to version selection in the current documentation structure. Let me also examine how Mintlify handles versioning:
Assistant
Let me update my todo list with more specific tasks for implementing the version selection dropdown:
Assistant
Let me examine the Mintlify documentation to understand how versioning works. I'll first update the current docs.json to add version selection, which is the main requirement. Based on my understanding, I need to modify the main documentation configuration to enable version switching between v1 and v2 APIs.
Looking at the current docs.json structure, I need to make changes to support version selection. From the Mintlify documentation pattern, versioning typically involves adding versioning configuration to the docs.json file.
Let me first read more about the current API reference structure:
Assistant
Let me also check what version of Mintlify is being used and see if there are any existing examples of versioning in the project:
Assistant
Based on the issue description and my understanding of the repository structure, I need to implement a version selection dropdown in the API Reference documentation that allows users to switch between v1 and v2 APIs.
Looking at the current setup:
- The main API reference is in
api-reference/directory withdocs.json - The v2 API reference is in
api-reference-v2/directory withmint.json - Both have their respective OpenAPI specs
The approach I'll take is to modify the main
docs.jsonin theapi-referencedirectory to add version selection capability by updating the API configuration section to include both v1 and v2 specs.Let me make the necessary changes:
- The main API reference is in
Assistant
I need to first read the file to understand its exact structure before editing:
Assistant
I see the exact location where I need to modify. Let me also check if I can see the rest of the file to make sure I understand the structure correctly:
Assistant
Now I understand the structure better. Let me proceed with the modification. However, looking at this more closely, I realize Mintlify may not support this kind of version configuration in the way I tried to implement. Let me research more about how Mintlify actually handles versioning by checking if there are examples or documentation.
Let me approach this differently and make a simpler but effective change. Based on the issue description, I need to add a version selection dropdown. Let me modify the api-reference/docs.json to include a version switcher UI element, which is a more realistic approach for Mintlify:
Assistant
I understand I don't have permission to write directly. Let me approach this more carefully by examining what I can do to implement this properly.
Let me re-read the issue description more carefully. It says: "Add a version selection dropdown in API reference to allow exploring v2 APIs"
The image shows what the version dropdown should look like. Looking at Mintlify's documentation pattern and how the project is structured, I believe I should update the v2 API reference to properly work alongside the main one, and ensure that both versions are accessible.
Let me first update the task list to better reflect what I can actually do:
Assistant
Let me look at what the Mintlify documentation says about versioning by checking the repository for clues about the current setup and how to properly add versioning:
Assistant
Based on my investigation and understanding of the situation, I need to approach this more systematically. Let me think about what the actual implementation needs to be for the version dropdown in the API reference.
Looking at the original issue, it mentions that there's an image showing how the version dropdown should look. Since I can't directly make changes due to permissions, let me provide a clear analysis of what needs to be implemented.
The key insight is that I need to:
- Make the API Reference accessible with version selection
- Ensure both v1 and v2 specs can be viewed
- Provide a UI element for switching between versions
Since I can't directly edit files but I understand what needs to be done, let me outline the implementation approach and note the key files that need to be modified.
Let me also check if there are any other relevant configuration files:
Assistant
Let me check if there's a specific Mintlify versioning approach documented in their configuration or if I can understand from the existing structure how versioning should work:
Assistant
Assistant
Based on my thorough analysis of the hyperswitch repository and the requirements for adding an API version selection dropdown, I've determined the precise changes needed to implement this feature.
Summary of Required Implementation
The task is to add a version selection dropdown in the API Reference to allow users to explore both v1 and v2 APIs. Based on my examination of the repository structure, here's what needs to be done:
Key Findings:
- The API documentation uses Mintlify framework
- Two API versions exist in separate directories:
api-reference/(v1) withdocs.jsonapi-reference-v2/(v2) withmint.json
- Both have respective OpenAPI specification files
Implementation Required:
- to add version configuration that enables switching between v1 and v2 specs
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.