@autorest/openapi-to-typespec
Version:
Autorest plugin to scaffold a Typespec definition from an OpenAPI document
21 lines • 717 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFirstEndpoint = void 0;
function getFirstEndpoint(model) {
var _a;
for (const group of model.operationGroups) {
for (const operation of group.operations) {
for (const request of (_a = operation.requests) !== null && _a !== void 0 ? _a : []) {
if (!request.protocol.http) {
continue;
}
const endpoint = request.protocol.http.uri;
if (endpoint) {
return endpoint;
}
}
}
}
}
exports.getFirstEndpoint = getFirstEndpoint;
//# sourceMappingURL=get-endpoint.js.map
;