This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, NestMiddleware } from '@nestjs/common'; | |
import { Request, Response, NextFunction } from 'express'; | |
import { OpenAPI } from 'openapi-types'; | |
import axios from 'axios'; | |
import { createValidatorMiddleware } from 'openapi-enforcer-middleware'; | |
@Injectable() | |
export class OpenApiValidationMiddleware implements NestMiddleware { | |
private specifications: OpenAPI.Document[] = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 15s | |
evaluation_interval: 15s | |
scrape_timeout: 10s | |
rule_files: | |
# - "first.rules" | |
# - "second.rules" | |
scrape_configs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 15s | |
evaluation_interval: 15s | |
scrape_timeout: 10s | |
rule_files: | |
# - "first.rules" | |
# - "second.rules" | |
scrape_configs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global: | |
scrape_interval: 15s | |
evaluation_interval: 15s | |
scrape_timeout: 10s | |
rule_files: | |
# - "first.rules" | |
# - "second.rules" | |
scrape_configs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var expressObject = function(object,string){ | |
return string.split('.').reduce(function(a,b){ | |
return a[b]; | |
},object); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var flatten = function(array) { | |
return array.reduce(function(a,b) { | |
return a.concat(Array.isArray(b) | |
? flatten(b) | |
: [b] ); | |
},[]); | |
}; |