Given a Swagger API, explain how you would build a user interface for it.
For this coding exercise, implement build_ui_model to transform a Swagger specification into ordered endpoint models suitable for rendering forms and response information. Preserve path and method order, merge path-level and operation-level parameters, and choose the lowest successful HTTP status.
Input is a Swagger-like dictionary; output is a list of operation dictionaries. Use the signature build_ui_model(swagger).
swagger contains a paths dictionary.parameters list.parameters and responses when those fields are present.default.name and in location.def build_ui_model(swagger):