예제 #1
0
        /// <summary>
        /// Create an API builder. The builder is used to build API and operations out of SwaggerDocument.
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="setting"></param>
        /// <returns>API builder</returns>
        public static APIBuilder GetBuilder(AbstractSwaggerReader reader, APIBuilderSetting setting = null)
        {
            if (reader == null)
            {
                throw new SwaggerResourceException("SwaggerReader cannot be null");
            }
            if (reader.GetSwaggerObject() == null)
            {
                throw new SwaggerResourceException("SwaggerDocument cannot be null");
            }

            APIBuilder builder = new APIBuilder()
            {
                _swagger = reader.GetSwaggerObject(),
                _setting = (setting == null) ? new APIBuilderSetting() : setting,
            };

            return(builder);
        }
예제 #2
0
 public APIMetatDataBuilder(APIBuilder builder)
 {
     this._builder = builder;
 }
예제 #3
0
 public OperationBuilder(APIBuilder builder)
 {
     this._builder = builder;
 }