Skip to content

Normalize controller routes when merged with route prefix#308

Merged
Blacksmoke16 merged 2 commits intomasterfrom
prefixed-route-params
Sep 17, 2023
Merged

Normalize controller routes when merged with route prefix#308
Blacksmoke16 merged 2 commits intomasterfrom
prefixed-route-params

Conversation

@Blacksmoke16
Copy link
Member

require "athena"

@[ARTA::Route(path: "/api")]
class Users < ATH::Controller
  @[ARTA::Get("")]
  def list : String
    "list"
  end

  @[ARTA::Get("{id}")]
  def index(id : Int32) : Int32
    id
  end
end

ATH.run

Fixes the #index method's path previously being /api{id} and instead normalizes it to be the expected /api/{id} path.

@Blacksmoke16 Blacksmoke16 added kind:bug An existing feature isn't working as expected component:framework labels Sep 15, 2023
@Blacksmoke16 Blacksmoke16 merged commit a775bf3 into master Sep 17, 2023
@Blacksmoke16 Blacksmoke16 deleted the prefixed-route-params branch September 17, 2023 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component:framework kind:bug An existing feature isn't working as expected

Development

Successfully merging this pull request may close these issues.

1 participant