Skip to content

List all templates (MVP)#2

Merged
bartolomej merged 1 commit into
masterfrom
add-list-snapshots-endpoint
Nov 12, 2023
Merged

List all templates (MVP)#2
bartolomej merged 1 commit into
masterfrom
add-list-snapshots-endpoint

Conversation

@bartolomej

@bartolomej bartolomej commented Nov 11, 2023

Copy link
Copy Markdown
Member

Modify an existing /v1/templates endpoint to retrieve all templates instead of throwing an error, if name query parameter isn't provided.

This is technically a breaking change, so if we'd wanna merge this to the main repo, we'd need to move this logic to v2 endpoints added here: onflow#28

This isn't an ideal solution for a few reasons:

  • this same endpoint now returns either a list of templates, a single template, or an empty value (if using the name query param)
    • it could be a more flexible approach to let it only return a list of resources. In that way, this could be a general purpouse search endpoint, possibly supporting multiple query params and always returning a list of search results.
  • always returning all snapshots in the database, may not be a scalable solution long term
    • it should be fine for now, as there are only a couple hundred templates available (when counting the seeded ones only)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant