Skip to content

Commit

Permalink
feature: removed setting up default endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
akeemphilbert committed Apr 9, 2024
1 parent 481990f commit 7085430
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 25 deletions.
82 changes: 82 additions & 0 deletions rest/fixtures/blog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -879,3 +879,85 @@ paths:
200:
description: Delete author

/*:
get:
summary: Get resources
responses:
'200':
description: Resource
content:
application/ld+json:
schema:
type: object
properties:
'@id':
type: string
description: The resource id
'@type':
type: string
description: The resource type

put:
summary: Create resource
responses:
'201':
description: Resource
content:
application/ld+json:
schema:
type: object
properties:
'@id':
type: string
description: The resource id
'@type':
type: string
description: The resource type
post:
summary: Create resource
responses:
'201':
description: Resource
content:
application/ld+json:
schema:
type: object
properties:
'@id':
type: string
description: The resource id
'@type':
type: string
description: The resource type
patch:
summary: Update resource
responses:
'201':
description: Resource
content:
application/ld+json:
schema:
type: object
properties:
'@id':
type: string
description: The resource id
'@type':
type: string
description: The resource type
delete:
summary: Delete resource
responses:
'201':
description: Resource
content:
application/ld+json:
schema:
type: object
properties:
'@id':
type: string
description: The resource id
'@type':
type: string
description: The resource type
25 changes: 0 additions & 25 deletions rest/initializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,31 +259,6 @@ func RouteInitializer(p RouteParams) (err error) {

}
}

p.Echo.Add(http.MethodPost, p.APIConfig.BasePath+"/*", DefaultWriteController(&ControllerParams{
Logger: p.Logger,
CommandDispatcher: p.CommandDispatcher,
ResourceRepository: p.ResourceRepository,
Schema: p.Config,
}))
p.Echo.Add(http.MethodPut, p.APIConfig.BasePath+"/*", DefaultWriteController(&ControllerParams{
Logger: p.Logger,
CommandDispatcher: p.CommandDispatcher,
ResourceRepository: p.ResourceRepository,
Schema: p.Config,
}))
p.Echo.Add(http.MethodPatch, p.APIConfig.BasePath+"/*", DefaultWriteController(&ControllerParams{
Logger: p.Logger,
CommandDispatcher: p.CommandDispatcher,
ResourceRepository: p.ResourceRepository,
Schema: p.Config,
}))
p.Echo.Add(http.MethodGet, p.APIConfig.BasePath+"/*", DefaultReadController(&ControllerParams{
Logger: p.Logger,
CommandDispatcher: p.CommandDispatcher,
ResourceRepository: p.ResourceRepository,
Schema: p.Config,
}))
p.Echo.Use(middleware.CORS())

return err
Expand Down

0 comments on commit 7085430

Please sign in to comment.