Skip to content

[Bug Report: API Field Incorrect] calendars API free slots response definition #191

Description

@bweston92

🐛 Describe the Bug

GetSlotsSuccessfulResponseDto generates code that is not useful.

See:

"GetSlotsSuccessfulResponseDto": {
"type": "object",
"properties": {
"_dates_": {
"$ref": "#/components/schemas/SlotsSchema"
}
},
"required": [
"_dates_"
]
},

Whilst using oapi v3.0 can we add additionalProperties and set it to true so the generated code allows us to handle this better.

Example:

      "GetSlotsSuccessfulResponseDto": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "_dates_": {
            "$ref": "#/components/schemas/SlotsSchema"
          }
        },
        "required": [
          "_dates_"
        ]
      },

Or, if you're ok to bump to oapi v3.1 we can make it use

Example:

      "GetSlotsSuccessfulResponseDto": {
        "type": "object",
        "patternProperties": {
          "^[0-9]{4}-[0-9]{2}-[0-9]{2}$": {
            "type": "object",
            "properties": {
              "slots": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "required": [
              "slots"
            ]
          }
        }
      },

Let me know if this is something we can progress with.

📍 API Endpoint

/calendars/{calendarId}/free-slots

✅ Expected Behavior

A type was generated that is easy to work with.

💻 Screenshots or Code Samples

A generated Go snippet where the key is expected to be _dates_.

type GetSlotsSuccessfulResponseDto struct {
	UnderscoreDates      SlotsSchema            `json:"_dates_"`
}

It would at least be better to add additional properties to have the following:

type GetSlotsSuccessfulResponseDto struct {
	UnderscoreDates      SlotsSchema            `json:"_dates_"`
	AdditionalProperties map[string]interface{} `json:"-"`
}

This would be we can use the additional properties.

Product Area

calendars

📋 Use Case

List availability from a calendar.

🚨 Why Should This Be Prioritized?

It's a nice to have.

🧠 Additional Context

No response

Metadata

Metadata

Assignees

Labels

bug-missing-api-fieldSomething isn't working in the Highlevel API or fields are missing in the API Endpoints.calendarsprocessed

Type

No fields configured for Task.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions