ApiSpecBuilder

class ApiSpecBuilder(workspace: Workspace) : IResourceBuilder<ApiSpec>

ApiSpec resource builder

Samples

import com.yamilovs.insomnia.exporter.model.*
import com.yamilovs.insomnia.exporter.model.Collection
import com.yamilovs.insomnia.exporter.model.request.FollowRedirect
import com.yamilovs.insomnia.exporter.model.request.Method
import com.yamilovs.insomnia.exporter.model.request.authentication.EmptyAuthentication
import com.yamilovs.insomnia.exporter.model.request.body.EmptyBody
import com.yamilovs.insomnia.exporter.model.request.header.Header
import com.yamilovs.insomnia.exporter.model.request.parameter.Parameter
import java.net.URL
fun main() { 
   //sampleStart 
   val workspace = Workspace()

ApiSpec.build(workspace) {

    // setting up fileName property
    // next function call will rewrite previous value
    fileName("About workspace")
    fileName { "About workspace" }
} 
   //sampleEnd
}

Constructors

Link copied to clipboard
fun ApiSpecBuilder(workspace: Workspace)

Functions

Link copied to clipboard
open override fun build(): ApiSpec
Link copied to clipboard
fun fileName(init: () -> String): ApiSpecBuilder
fun fileName(fileName: String): ApiSpecBuilder