API Connect

API Connect

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Empty root level API security is not a secure practice. Please check if you need it or remove {} from API security.

  • 1.  Empty root level API security is not a secure practice. Please check if you need it or remove {} from API security.

    Posted 21 hours ago
    Hi Everybody
    i am new API Connect Developer
    can you help me for fix for this page?
    i dont understand about that
    thank you very much
    Empty root level API security is not a secure practice. Please check if you need it or remove {} from API security.


    ------------------------------
    Andi Putra Ogie
    ------------------------------


  • 2.  RE: Empty root level API security is not a secure practice. Please check if you need it or remove {} from API security.

    Posted 20 hours ago

    Hi Andi Putra Ogie

    Welcome to API Connect development!

    The warning "Empty root level API security is not a secure practice" occurs because your API definition includes a security section at the root level that is empty or has no security schemes enabled.

    To resolve this:

    • If your API requires security, make sure to specify and enable the appropriate security schemes defined under securitySchemes in your API specification. For example:security:
        - api_key: []

    • If your API does not require any security, simply remove the entire security section from the root level of your API definition.

    Trying to save the API with an empty or empty-object security section will cause this warning. Adjusting the security section as described will help you fix the issue.

    If you want, please share your API spec snippet and a screenshot of security section, and I'll be happy to help you further.

    Hope this helps!



    ------------------------------
    Mounika Nayikoti
    ------------------------------