Skip to content

Commit

Permalink
Support host path
Browse files Browse the repository at this point in the history
  • Loading branch information
kairu-ms committed Sep 13, 2024
1 parent 8be9ea2 commit ad2d8c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/aaz_dev/swagger/controller/command_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from swagger.model.schema.cmd_builder import CMDBuilder
from swagger.model.schema.fields import MutabilityEnum
from swagger.model.schema.path_item import PathItem
from swagger.model.schema.x_ms_parameterized_host import XmsParameterizedHost
from swagger.model.specs import SwaggerLoader
from swagger.model.specs._utils import operation_id_separate, camel_case_to_snake_case, get_url_path_valid_parts
from swagger.model.schema.typespec.path_item import TypeSpecPathItem
Expand Down Expand Up @@ -549,7 +550,10 @@ def get_path_item(self, resource):

def get_parameterized_host(self, resource):
swagger = self.loader.get_loaded(resource.file_path)
return swagger.x_ms_parameterized_host
if swagger.x_ms_parameterized_host:
return swagger.x_ms_parameterized_host
elif swagger.base_path:
return XmsParameterizedHost({"hostTemplate": swagger.base_path})

def generate_operation(self, cmd_builder, path_item, instance_var, **kwargs):
assert isinstance(path_item, PathItem)
Expand Down

0 comments on commit ad2d8c5

Please sign in to comment.