Skip to content

bug: API-driven standalone mode does not properly handle consumer schema checks #12253

Description

@bzp2010

Current Behavior

The consumers does not support inputs that contain a modifiedIndex field.

The core.config.new(“/consumers”, cfg) does not include an item_schema input similar to the other resources because consumers needs to handle both consumer and consumer_credential resources under the same key.
It just passes in a function that checks the schema and determines the resource type by key and performs specific checks if needed.
The additional field modifiedIndex that we have now introduced in config_yaml cannot be applied to the internal check function of consumers, so the check will output an error.

Expected Behavior

Consistent with other resources.

Error Logs

invalid consumers at index 0, err: additional properties forbidden, found modifiedIndex

Steps to Reproduce

  1. Use the API to submit a consumer containing the modifiedIndex.

Environment

  • APISIX version (run apisix version): master
  • Operating system (run uname -a): N/A
  • OpenResty / Nginx version (run openresty -V or nginx -V): N/A
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info): N/A
  • APISIX Dashboard version, if relevant: N/A
  • Plugin runner version, for issues related to plugin runners: N/A
  • LuaRocks version, for installation issues (run luarocks --version): N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status
    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions