-
-
Notifications
You must be signed in to change notification settings - Fork 0
feat:Add /internal-testing endpoint to Ideogram API with OpenAPI update
#45
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -130,6 +130,19 @@ paths: | |
| summary: Testing | ||
| description: "Just a testing endpoint\n" | ||
| operationId: post_internal_testing | ||
| parameters: | ||
| - name: X-Test-Header | ||
| in: header | ||
| description: Test header | ||
| style: simple | ||
| schema: | ||
| type: string | ||
| - name: X-Test-Header-2 | ||
| in: header | ||
| description: Test header | ||
| style: simple | ||
| schema: | ||
| type: string | ||
|
Comment on lines
+133
to
+145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Enhance security measures for the internal testing endpoint. The internal testing endpoint needs additional security safeguards:
Apply this diff to improve security: post:
tags:
- internal-testing
summary: Testing
+ security:
+ - ApiKeyAuth: []
+ - TestEnvironmentAuth: []
+ x-security-options:
+ ip-whitelist:
+ - "127.0.0.1/32"
+ - "10.0.0.0/8"
+ rate-limit:
+ requests: 10
+ period: 1mAdd the following security scheme to the components section: securitySchemes:
+ TestEnvironmentAuth:
+ type: apiKey
+ description: Special API key for test environment access
+ name: Test-Environment-Key
+ in: header
🛠️ Refactor suggestion Enhance documentation and add environment restrictions for the internal testing endpoint. The internal testing endpoint requires additional documentation and safeguards:
Apply this diff to improve the endpoint definition: post:
tags:
- internal-testing
summary: Testing
- description: "Just a testing endpoint\n"
+ description: |
+ Internal testing endpoint for validating multipart/form-data request handling.
+ WARNING: This endpoint is for internal testing purposes only and should not be used in production.
+
+ Test coverage:
+ - Header parameter validation
+ - Complex nested object serialization
+ - File upload handling
+ - Date/DateTime format validation
operationId: post_internal_testing
+ servers:
+ - url: http://localhost:8080
+ description: Local development
+ - url: http://test.ideogram.ai
+ description: Test environment
|
||
| requestBody: | ||
| description: A request for testing. | ||
| content: | ||
|
|
@@ -1105,7 +1118,6 @@ components: | |
| - OFF | ||
| type: string | ||
| description: Determine if MagicPrompt should be used in generating the request or not | ||
| default: AUTO | ||
| externalDocs: | ||
| url: https://docs.ideogram.ai/using-ideogram/ideogram-features/magic-prompt | ||
| example: ON | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Improve header parameter documentation and add validation.
The header parameters need distinct descriptions and proper validation:
Apply this diff to enhance the header parameters:
parameters: - name: X-Test-Header in: header - description: Test header + description: Primary test header for basic string validation style: simple schema: type: string + minLength: 1 + maxLength: 50 + pattern: '^[a-zA-Z0-9-_]+$' + example: "test-header-value" + required: true - name: X-Test-Header-2 in: header - description: Test header + description: Secondary test header for optional metadata style: simple schema: type: string + format: uuid + example: "123e4567-e89b-12d3-a456-426614174000"📝 Committable suggestion