Füge benutzerdefinierte JSON-Unmarshaling-Logik für Zeitfelder hinzu; verbessere die Handhabung von optionalen Zeitwerten

This commit is contained in:
Gregor Schulte
2026-02-17 12:53:56 +01:00
parent 79caa168db
commit 727eba0e5e
2 changed files with 240 additions and 25 deletions

View File

@@ -46,24 +46,24 @@ func (s *BlockTypesService) GetBySlug(ctx context.Context, slug string) (*models
// List retrieves block types with optional filtering.
func (s *BlockTypesService) List(ctx context.Context, filter *models.BlockTypeFilter, offset, limit int) ([]models.BlockType, error) {
type nameFilter struct {
Like *string `json:"like_,omitempty"`
Like *string `json:"like,omitempty"`
}
type slugFilter struct {
Any []string `json:"any_,omitempty"`
Any []string `json:"any,omitempty"`
}
type blockTypeFilterCriteria struct {
Name *nameFilter `json:"name,omitempty"`
Slug *slugFilter `json:"slug,omitempty"`
}
type capabilitiesFilter struct {
All []string `json:"all_,omitempty"`
All []string `json:"all,omitempty"`
}
type blockSchemaFilterCriteria struct {
Capabilities *capabilitiesFilter `json:"block_capabilities,omitempty"`
}
type request struct {
BlockTypes *blockTypeFilterCriteria `json:"block_types,omitempty"`
BlockSchemas *blockSchemaFilterCriteria `json:"block_schemas,omitempty"`
BlockSchemas *blockSchemaFilterCriteria `json:"block_schemas,omitempty"`
Offset int `json:"offset,omitempty"`
Limit int `json:"limit,omitempty"`
}