openapiutils

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 24, 2018 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostFromURL added in v0.1.5

func GetHostFromURL(url string) string

GetHostFromURL returns the fqdn of a given string (localhost including port number is also handled). Example domains that would match: - http://domain.com/ - domain.com/parameter - domain.com?anything - example.domain.com - example.domain-hyphen.com - www.domain.com - localhost - localhost:8080 Example domains that would not match: - http://domain.com:8080 (this use case is not support at the moment, it is assumed that actual domains will use standard ports)

func GetSchemaDefinition added in v0.3.1

func GetSchemaDefinition(definitions map[string]spec.Schema, ref string) (*spec.Schema, error)

GetSchemaDefinition queries the definitions and tries to find the schema definition for the given ref. If the schema definition the ref value is pointing at does not exist and error is returned. Otherwise, the corresponding schema definition is returned.

func StringExtensionExists added in v0.3.0

func StringExtensionExists(extensions spec.Extensions, key string) (string, bool)

StringExtensionExists tries to find a match using the built-in extensions GetString method and if there is no match it will try to find a match without converting the key lower case (as done behind the scenes by GetString method). Context: The Extensions look up methods tweaks the given key making it lower case and then trying to match against the keys in the map. However this may not always work as the Extensions might have been added without going through the Add method which lower cases the key, though in situations where the struct was un-marshaled directly instead this translation would not have happened and therefore the look up queiry will not find matches

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL