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

The data field missing in API spec (collections.yaml) #1317

Closed
stargazer33 opened this issue May 9, 2023 · 2 comments
Closed

The data field missing in API spec (collections.yaml) #1317

stargazer33 opened this issue May 9, 2023 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@stargazer33
Copy link

stargazer33 commented May 9, 2023

Version:

The API specification in collections.yaml contains multiple errors:
There are many places where the data field is missing in the API response.

Here an example (line 700 in collections.yaml):

  "/lists/{list_id}":
    get:
      description: retrieves lists with additional metadata like subscriber counts. This may be slow.
      tags:
        - Lists
      parameters:
        - in: path
          name: list_id
          required: True
          description: The id value of the list you want to retreive.
          schema:
            type: number

      responses:
        "200":
          description: response.
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/List"

This creates the following documentation, see screenshot:
listmonk app_docs_swagger_#Lists_get_lists__list_id

But this is all wrong, see the actual response from Listmonk (mind the data field in response):

{
  "data": {
    "id": 9,
    "created_at": "2023-05-08T19:09:58.043616+02:00",
    "updated_at": "2023-05-08T19:09:58.043616+02:00",
    "uuid": "d4cb3953-955a-4b24-8b8c-6dcc6df1553f",
    "name": "My cool list",
    "type": "public",
    "optin": "double",
    "tags": [
      "tag2",
      "W"
    ],
    "description": "",
    "subscriber_count": 0,
    "subscriber_statuses": {},
    "subscription_created_at": null,
    "subscription_updated_at": null
  }
}

There are many places in collections.yaml where the data field is missing!
I know about these places:
POST /lists
GET /lists/{list_id}
PUT /lists/{list_id}

Please check the collections.yaml, as far as I understand this data field should be in each and every response

@stargazer33 stargazer33 added the bug Something isn't working label May 9, 2023
@knadh
Copy link
Owner

knadh commented May 9, 2023

Tagging @rohansh-tty who contributed the collection to the repo.

@knadh knadh added documentation Improvements or additions to documentation and removed bug Something isn't working labels May 9, 2023
@stargazer33
Copy link
Author

stargazer33 commented May 9, 2023

There are many places in collections.yaml where the data field is missing!
I know about these places: POST /lists GET /lists/{list_id} PUT /lists/{list_id}

One more place where data field is missing:
This is the *.yml file:

  /subscribers:
    ...
    post:
      description: handles creation of new subscriber
    ...
      responses:
        "200":
          description: response
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Subscriber"

And this is the real JSON response:

{
  "data": {
    "id": 14,
    "created_at": "2023-05-10T00:32:14.907272+02:00",
    "updated_at": "2023-05-10T00:32:14.907272+02:00",
    "uuid": "028b7b88-df5a-464c-8579-aa7d68b4a363",
    "email": "test0005@mycoolemail",
    "name": "test0005@mycoolemail",
    "attribs": {},
    "status": "enabled",
    ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants