code: func (c *SpaceCodebasesController) List(ctx *app.ListSpaceCodebasesContext) error {
  	offset, limit := computePagingLimits(ctx.PageOffset, ctx.PageLimit)
  	var codebases []codebase.Codebase
  	var count int
  	err := application.Transactional(c.db, func(appl application.Application) error {
  		err := appl.Spaces().CheckExists(ctx, ctx.SpaceID)
  		if err != nil {
  			return err
  		}
  
  		codebases, count, err = appl.Codebases().List(ctx, ctx.SpaceID, &offset, &limit)
  		return err
  	})
  	if err != nil {
  		return jsonapi.JSONErrorResponse(ctx, err)
  	}
  	res := &app.CodebaseList{
  		Data:  ConvertCodebases(ctx.Request, codebases),
  		Meta:  &app.CodebaseListMeta{TotalCount: count},
  		Links: &app.PagingLinks{},
  	}
  	setPagingLinks(res.Links, buildAbsoluteURL(ctx.Request), len(codebases), offset, limit, count)
  	return ctx.OK(res)
  }
docs: // List runs the list action.