jsonapi

package
v0.0.0-...-e38db06 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Envelope

type Envelope map[string]any

Envelope

type ErrorData

type ErrorData struct {
	Source *ErrorSourcePointer `json:"source,omitempty"`
	Title  string              `json:"title"`
	Detail string              `json:"detail"`
}

ErrorData

type ErrorResponse

type ErrorResponse struct {
	Errors []ErrorData `json:"errors"`
}

ErrorResponse

type ErrorSourcePointer

type ErrorSourcePointer struct {
	Pointer string `json:"pointer,omitempty"`
}

ErrorSourcePointer

type RequestBody

type RequestBody struct {
	Data *RequestResource `json:"data" validate:"required"`
}

RequestBody

type RequestResource

type RequestResource struct {
	Type       string `json:"type" validate:"required"`
	ID         string `json:"id" validate:"omitempty,uuid4"`
	Attributes any    `json:"attributes" validate:"required"`
}

RequestResource

type ResourceMetadata

type ResourceMetadata struct{}

ResourceMetadata

type Response

type Response struct {
	Meta *ResponseMetadata `json:"meta"`
	Data any               `json:"data"`
}

Response

type ResponseMetadata

type ResponseMetadata struct {
	Page pagination.PageMetadata `json:"page,omitempty"`
}

ResponseMetadata

type ResponseResource

type ResponseResource struct {
	Type       string            `json:"type"`
	ID         uuid.UUID         `json:"id"`
	Meta       *ResourceMetadata `json:"meta,omitempty"`
	Attributes any               `json:"attributes"`
}

Resource

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL