Skip to content
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

OpenAPI schema is not in line with REST API #4340

Open
timbms opened this issue Aug 9, 2024 · 0 comments
Open

OpenAPI schema is not in line with REST API #4340

timbms opened this issue Aug 9, 2024 · 0 comments
Labels
bug An unexpected problem or unintended behavior of the Core

Comments

@timbms
Copy link

timbms commented Aug 9, 2024

  1. openAPI schema for WidgetDTO is missing the recursive use of widgets
  2. Header Object has neither defined property schema nor content for /rules.
  3. X-Atmosphere-Framework is not available as header parameter for operationId = "pollDataForPage" and operationId = "pollDataForPage", though it is used in getPageData.

Expected Behavior

  1. A widget can contain widgets (for instance when using Frame in sitemap). Therefore widgetDTO schema needs this addition:
,
"widgets": {
  "type": "array",
  "items": {
    "$ref": "#/components/schemas/WidgetDTO"
  }
}
  1. Should set schema or content. I got over my blocking issues with the below manual correction to the json file.
    Also, in the same context I fixed a bug report by Apimatic "Simple style cannot be used with the current header type." Please note, I am not using the response and could therefore not check the validity for the response. The correction just got me over the build error.
"responses": {
          "201": {
            "description": "Created",
            "headers": {
              "Location": {
                "description": "Newly created Rule",
                "schema": {
              	  "type": "string"
            	}
              }
            }
          },

Apimatic VSCode plugin gives this explanation:

The Header Object must define the type schema for the header using either the schema or content property. The former is used more commonly while the latter is recommended for more complex scenarios involving media types. However, at one time, only one of these properties must be present and not both.

The simple style can only be used when the type of the header is set as array i.e. it cannot be used for primitive or object types.

  1. Currently requires a manual correction of the openAPI schema.

Current Behavior

  1. Response from server does not match openAPI schema
  2. swift-openapi-generator is blocked by this error
  3. OpenAPI spec is incomplete

Steps to Reproduce (for Bugs)

use api-explorer

Context

Not able to generate api code with swift-openapi-generator

Your Environment

  • Version used: 4.2.0
@timbms timbms added the bug An unexpected problem or unintended behavior of the Core label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of the Core
Projects
None yet
Development

No branches or pull requests

1 participant