Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option override the path config in nested routes #190

Closed
jeevatkm opened this issue Jun 22, 2018 · 1 comment
Assignees
Projects

Comments

@jeevatkm
Copy link
Member

@jeevatkm jeevatkm commented Jun 22, 2018

The goal is to added an option to override the path config on nested routes.

Current behavior:

  • Inherits parent path config as-is if child one is not defined otherwise prefixes parent path with child path

This enhancement:

  • Adds an option to override the path value without parent prefix using symbol ^

Example:

api_v1 {
    path = "/v1"
    auth = "anonymous"

    routes {
        all_values {
            path = "/values"
            controller = "v1/ValueController"
            action = "List"

            routes {
                value_create {                  # /v1/values
                    method = "POST"
                }
                value_override_path {           # /v1/supervalues <==> /v1/values
                    path = "^/v1/supervalues"                    
                }
                value_get {                     # /v1/values/:key      
                    path = "/:key"

                    routes {                  
                        value_update {          # /v1/values/:key
                            method = "PUT"
                        }
                        value_delete {          # /v1/values/:key
                            method = "DELETE"
                        }
                    }
                }
            }
        } # end - all_values
    }
} # end - api_v1
@jeevatkm jeevatkm added this to the v0.11.0 Milestone milestone Jun 22, 2018
@jeevatkm jeevatkm self-assigned this Jun 22, 2018
@jeevatkm jeevatkm added this to v0.11.0 - Iteration in aah Roadmap via automation Jun 22, 2018
jeevatkm added a commit to go-aah/router that referenced this issue Jun 22, 2018
@jeevatkm jeevatkm moved this from v0.11.0 - Iteration to v0.11.0 - In Progress in aah Roadmap Jun 22, 2018
@jeevatkm

This comment has been minimized.

Copy link
Member Author

@jeevatkm jeevatkm commented Jun 22, 2018

Its done 😄

@jeevatkm jeevatkm closed this Jun 22, 2018
aah Roadmap automation moved this from v0.11.0 - In Progress to v0.11.0 - Completed Jun 22, 2018
@jeevatkm jeevatkm moved this from v0.11.0 - Completed to Released to Audience in aah Roadmap Jul 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
aah Roadmap
  
Released to Audience
1 participant
You can’t perform that action at this time.