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

Transform config keys to config.key format on plugin create and update #12

Merged
merged 2 commits into from
Apr 20, 2017

Conversation

nevalla
Copy link
Contributor

@nevalla nevalla commented Apr 20, 2017

No description provided.

headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
attributes = { 'api_id' => ':api_id', 'config.anonymous' => '12345' }
expect(Kong::Client.instance).to receive(:patch).with('/apis/:api_id/plugins/', nil, attributes, headers).and_return(attributes)
subject = described_class.new({ api_id: ':api_id', config: { 'anonymous' => '12345'} })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inside } missing.

headers = { 'Content-Type' => 'application/x-www-form-urlencoded' }
attributes = { 'api_id' => ':api_id', 'config.anonymous' => '12345' }
expect(Kong::Client.instance).to receive(:post).with('/apis/:api_id/plugins/', nil, attributes, headers).and_return(attributes)
subject = described_class.new({ api_id: ':api_id', config: { 'anonymous' => '12345'} })

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Space inside } missing.

@nevalla nevalla merged commit c6eaca9 into master Apr 20, 2017
@nevalla nevalla deleted the fix/plugin_config_keys_on_create branch April 20, 2017 07:38
amireh added a commit to amireh/kong-client-ruby that referenced this pull request Jul 18, 2018
this builds upon PR kontena#12 in that it extends the support to also cover
plugin configuration that is deeply nested:

    config = {
      a = {
        b = 1,
        c = 2
      }
    }

    # => {
    #      "config.a.b" => 1,
    #      "config.a.c" => 2
    #    }
nevalla pushed a commit that referenced this pull request Sep 7, 2018
this builds upon PR #12 in that it extends the support to also cover
plugin configuration that is deeply nested:

    config = {
      a = {
        b = 1,
        c = 2
      }
    }

    # => {
    #      "config.a.b" => 1,
    #      "config.a.c" => 2
    #    }
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.

2 participants