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

Errors in Listmonk swagger API spec. (see https://listmonk.app/docs/swagger/collections.yaml ) #1308

Closed
stargazer33 opened this issue May 7, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@stargazer33
Copy link

stargazer33 commented May 7, 2023

Version:
latest, see https://listmonk.app/docs/swagger/collections.yaml

Description of the bug and steps to reproduce:
I want to create a client for Listmonk API (Swagger).
So I use the openapi-generator to create the client code in my programming language.
As part of code generation process this tool VALIDATES the API specification

There are errors during valudation process, see below.
This tool (openapi-generator) found 6 errors in the Listmonk API
I think, this should be fixed

Steps to reproduce:

  1. Check your Java version (and install Java if necessary).
    We need Java 1.8.X or more
$ java -version
java version "1.8.0_151"
...
  1. Download the openapi-generator CLI as in documentation https://openapi-generator.tech/docs/installation/#jar
wget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/6.5.0/openapi-generator-cli-6.5.0.jar -O openapi-generator-cli.jar
  1. Run the openapi-generator "validate" command:
java -jar openapi-generator-cli.jar validate -i https://listmonk.app/docs/swagger/collections.yaml

Screenshots:

$ java -jar openapi-generator-cli.jar validate -i https://listmonk.app/docs/swagger/collections.yaml 
Validating spec (https://listmonk.app/docs/swagger/collections.yaml)
Errors:
	- attribute
	  paths.'/subscribers/{id}/bounces'(get).responses.200.content.'application/json'.schema.items
	  is missing
	- paths.'/campaigns/{campaign_id}/text'. Declared path parameter campaign_id needs to be
	  defined as a path parameter in path or operation level
	- attribute paths.'/bounces'(get).responses.200.content.'application/json'.schema.items is
	  missing
	- paths.'/lists/{list_id}'. Declared path parameter list_id needs to be defined as a path
	  parameter in path or operation level
	- paths.'/media/{media_id}'. Declared path parameter media_id needs to be defined as a path
	  parameter in path or operation level
	- paths.'/bounces/{id}'. Declared path parameter id needs to be defined as a path parameter
	  in path or operation level

[error] Spec has 6 errors.
@stargazer33 stargazer33 added the bug Something isn't working label May 7, 2023
@stargazer33 stargazer33 changed the title Errors in Listmonk swagger API (see https://listmonk.app/docs/swagger/collections.yaml ) Errors in Listmonk swagger API spec. (see https://listmonk.app/docs/swagger/collections.yaml ) May 7, 2023
@knadh
Copy link
Owner

knadh commented May 8, 2023

CC @rohansh-tty

@stargazer33
Copy link
Author

stargazer33 commented May 8, 2023

UPDATE:

  1. the /campaigns description in the *.yml file is also not correct, the query parameter is missing:
/campaigns:
    get:
      description: handles retrieval of campaigns
      parameters:
        - in: query
          name: page
          description: Page number for paginated results
          schema:
            type: integer
            format: int32
        - in: query
          name: per_page
          description: max number of records to return per page
          schema:
            type: integer
            format: int32
  1. the layout in the swagger API description (see https://listmonk.app/docs/apis/campaigns/#get-apicampaigns) is broken:
    layout-broken

rohansh-tty added a commit to rohansh-tty/listmonk that referenced this issue May 8, 2023
@knadh knadh closed this as completed in 5a26279 May 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants