Commit fa99fccc authored by Jorge Moratinos's avatar Jorge Moratinos
Browse files

Merge branch...

Merge branch 'SDK19-api_schema_translator-fails-when-openapi-path-items-contain-path-level-parameters' into 'staging'

fix: filter non- HTTP path-item keys in aefProfiles building

See merge request !14
parents a8cad9ea 2915b1bf
Loading
Loading
Loading
Loading
+3 −0
Changes for opencapif_sdk/api_schema_translator.py: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -165,10 +165,13 @@ class api_schema_translator:
    def __build_aef_profiles(self, ip, port, api_version, fqdn=None, ipv6Addr=None, ):
        """Builds the aefProfiles section based on the paths and components in the API info."""
        aef_profiles = []
        http_methods = {"get", "put", "post", "delete", "options", "head", "patch", "trace"}

        resources = []
        for path, methods in self.api_info.get('paths', {}).items():
            for method, details in methods.items():
                if method.lower() not in http_methods:
                    continue
                resource = {
                    'resourceName': details.get('summary', 'Unnamed Resource'),
                    'commType': 'REQUEST_RESPONSE',