CrossClj

0.26.0 docs

SourceDocs



RECENT
    VARS
    convert-operation
    convert-parameters
    convert-responses
    default-response-description
    ensure-body-and-response-schema-names
    ensure-body-sub-schemas
    ensure-response-sub-schemas
    extract-models
    extract-parameter
    extract-paths-and-definitions
    option-defaults
    Options
    Swagger
    swagger-defaults
    swagger-json
    swagger-path
    transform-models
    transform-operations

    « Index of all namespaces of this project

    (convert-operation operation options)
    Returns a map with methods as keys and the Operation
    maps with parameters and responses transformed to comply
    with Swagger spec as values
    (convert-parameters parameters options)
    (convert-responses responses options)
    Private
    (default-response-description status options)
    uses option :default-response-description-fn to generate
    a default response description for status code
    (ensure-body-and-response-schema-names swagger)
    Takes a ring-swagger spec and returns a new version
    with a generated names for all anonymous nested schemas
    that come as body parameters or response models.
    (ensure-body-sub-schemas route)
    (ensure-response-sub-schemas route)
    (extract-models swagger)
    (extract-paths-and-definitions swagger options)
    (swagger-json swagger)(swagger-json swagger options)
    Inputs: ([swagger :- (s/maybe Swagger)] [swagger :- (s/maybe Swagger) options :- (s/maybe Options)])
    
    Produces swagger-json output from ring-swagger spec.
     Optional second argument is a options map, supporting
     the following options with defaults:
    
     :ignore-missing-mappings?        - (false) boolean whether to silently ignore
                                        missing schema to JSON Schema mappings. if
                                        set to false, IllegalArgumentException is
                                        thrown if a Schema can't be presented as
                                        JSON Schema.
    
     :default-response-description-fn - ((constantly "")) - a fn to generate default
                                        response descriptions from http status code.
                                        Takes a status code (Int) and returns a String.
    
     :handle-duplicate-schemas-fn     - (ring.swagger.core/ignore-duplicate-schemas),
                                        a function to handle possible duplicate schema
                                        definitions. Takes schema-name and set of found
                                        attached schema values as parameters. Returns
                                        sequence of schema-name and selected schema value.
    
     :collection-format               - Sets the collectionFormat for query and formData
                                        parameters.
                                        Possible values: multi, ssv, csv, tsv, pipes.
    (swagger-path uri)
    Replaces Compojure/Clout style path params in uri with Swagger style
    path params.
    
    Does not support wildcard-paths or inline-regexes.
    
    The regex is copied from Clout.
    (transform-models schemas options)
    (transform-operations f swagger)
    Transforms the operations under the :paths of a ring-swagger spec by applying (f operation)
    to all operations. If the function returns nil, the given operation is removed.