Meta tags:
description= Automatically generate RESTful API documentation with Swagger 2.0 for Go. - swaggo/swag;
Headings (most frequently used words):
to, use, type, uh, oh, add, swag, struct, of, navigation, how, the, types, multiple, enum, code, saved, searches, and, files, supported, with, api, info, security, about, contributors, license, packages, footer, descriptions, model, response, headers, description, tag, custom, field, generate, search, repositories, users, issues, pull, requests, provide, feedback, swaggo, declarative, comments, format, menu, filter, your, results, more, quickly, folders, latest, commit, history, repository, contents, getting, started, cli, web, frameworks, it, gin, formatter, implementation, status, general, operation, mime, param, data, attribute, examples, project, backers, sponsors, releases, 55, languages, using, markdown, available, future, over, lines, user, defined, structure, an, array, function, scoped, declaration, composition, in, request, path, params, paths, example, value, schemaexample, body, swaggertype, global, overrides, support, swaggerignore, exclude, extension, rename, display, annotations, from, constants, for, items, only, specific, docs, file, generics, change, default, go, template, action, delimiters, parse, internal, dependency, topics, resources, conduct, contributing, stars, watchers, forks,
Text of the page (most frequently used words):
the (141), string (70), type (64), name (64), #description (63), json (61), api (54), default (52), swagger (50), #example (48), swag (47), value (47), and (41), for (36), struct (36), this (35), you (32), use (32), docs (31), types (31), tag (31), with (30), param (30), code (29), format (27), http (24), object (23), accounts (23), can (22), github (22), files (22), int (22), account (22), security (21), file (21), false (21), url (20), that (19), license (19), all (19), https (19), must (19), data (19), query (19), support (18), success (18), path (18), your (17), see (17), separated (17), add (17), application (17), html (17), contact (16), parse (16), gin (16), 200 (15), enums (15), securitydefinitions (15), response (15), will (14), from (14), swaggo (14), version (14), jsonresult (14), org (14), schema (14), main (13), only (13), com (13), oauth2 (13), info (13), model (13), failure (13), validation (13), mime (13), httputil (13), init (12), request (12), comment (12), operation (12), true (12), array (12), err (12), get (12), tools (12), documentation (11), package (11), generated (11), order (11), general (11), comments (11), user (11), proto (11), ietf (11), draft (11), fge (11), section (11), markdown (11), fmt (11), generate (10), field (10), integer (10), multiple (10), tags (10), swaggertype (10), key (10), email (10), body (10), required (10), ctx (10), error (9), annotations (9), web (9), defined (9), post (9), func (9), which (9), write (9), yaml (9), return (9), router (9), header (9), folder (9), list (9), title (9), httperror (9), reload (8), project (8), fields (8), examples (8), like (8), set (8), desc (8), scope (8), exclude (8), using (8), foo (8), www (8), search (8), produce (8), accept (8), import (8), disabled (8), not (7), page (7), packages (7), image (7), comma (7), basic (7), doc (7), extension (7), number (7), parameters (7), parameter (7), values (7), server (7), collection (7), controller (7), host (7), swaggerinfo (7), view (7), time (6), information (6), there (6), was (6), please (6), custom (6), source (6), dependency (6), make (6), are (6), how (6), short (6), enum (6), difficulty (6), override (6), tokenurl (6), extensions (6), when (6), sql (6), used (6), nil (6), bin (6), message (6), descriptions (6), bar (6), options (6), auth (6), stream (6), summary (6), spaces (6), apis (6), operations (6), celler (6), externaldocs (6), apache (6), run (6), enterprise (6), navigation (5), while (5), loading (5), latest (5), contributing (5), resources (5), usage (5), output (5), have (5), apikeyauth (5), read (5), start (5), any (5), byte (5), address (5), 400 (5), function (5), csv (5), optional (5), annotation (5), take (5), open (5), external (5), listaccounts (5), community (4), terms (4), other (4), properties (4), readme (4), automatically (4), show (4), here (4), licenses (4), frameworks (4), parsedependency (4), want (4), both (4), internal (4), delimiters (4), more (4), details (4), genericnestedresponse (4), command (4), specific (4), class (4), need (4), one (4), first (4), const (4), each (4), oauth2application (4), access (4), oauth (4), token (4), follows (4), swaggerignore (4), note (4), possible (4), nullint64 (4), another (4), u3dhz2dlcibyb2nrcw (4), base64 (4), primitive (4), timestamptime (4), strconv (4), supported (4), test (4), put (4), group_id (4), group (4), headers (4), valid (4), multi (4), tab (4), authorizationurl (4), text (4), described (4), under (4), document (4), basepath (4), 8080 (4), formatter (4), directories (4), help (4), state (4), actions (4), issues (4), status (3), stars (3), conduct (3), openapi (3), topics (3), about (3), our (3), but (3), has (3), parseinternal (3), include (3), new (3), delimiter (3), generation (3), change (3), template (3), generics (3), would (3), outputtypes (3), items (3), medium (3), constants (3), admin (3), grants (3), basicauth (3), omitempty (3), nullable (3), paths (3), named (3), same (3), skip (3), replace (3), database (3), nullstring (3), global (3), overrides (3), crt (3), via (3), interface (3), parser (3), attribute (3), schemaexample (3), user_id (3), params (3), deepobject (3), also (3), myhandler (3), inside (3), structure (3), lines (3), baz (3), collectionformat (3), minlength (3), maxlength (3), minimum (3), maximum (3), available (3), password (3), implicit (3), form (3), deprecated (3), patch (3), schemes (3), base (3), localhost (3), termsofservice (3), sample (3), declarative (3), describing (3), context (3), 500 (3), 404 (3), find (3), app (3), newerror (3), showaccount (3), ginswagger (3), getting (3), started (3), cmd (3), commit (3), insights (3), pull (3), requests (3), signed (3), settings (3), window (3), refresh (3), session (3), sign (3), saved (3), feedback (3), grade (3), features (3), copilot (3), platform (3), solutions (3), explore (3), action (2), manage (2), footer (2), 2026 (2), contributors (2), releases (2), repository (2), forks (2), 13k (2), mit (2), restful (2), sponsor (2), become (2), sponsors (2), backers (2), exists (2), contribute (2), added (2), variety (2), gopher (2), work (2), 201 (2), limit (2), flag (2), different (2), asc (2), ordered (2), just (2), second (2), iota (2), hard (2), variant (2), easy (2), works (2), condition (2), rename (2), display (2), def (2), abc (2), mystruct (2), provided (2), directory (2), overridesfile (2), may (2), coeffs (2), overridden (2), specifying (2), unix (2), userid (2), username (2), jpg (2), groups (2), account_id (2), token2 (2), entity (2), myheader (2), data2 (2), data1 (2), overriding (2), uint (2), composition (2), naming (2), scoped (2), declaration (2), line (2), over (2), boolean (2), declares (2), determines (2), instances (2), formdata (2), pipes (2), tsv (2), ssv (2), results (2), 100 (2), mark (2), accesscode (2), apikey (2), event (2), gif (2), jpeg (2), png (2), octet (2), urlencoded (2), plain (2), xml (2), accepts (2), correct (2), some (2), then (2), consume (2), affects (2), such (2), unique (2), alternative (2), provides (2), images (2), following (2), authentication (2), implementation (2), existing (2), ensure (2), formatting (2), after (2), statusok (2), statusnotfound (2), godoc (2), aid (2), gonic (2), net (2), handler (2), swaggerfiles (2), wraphandler (2), middleware (2), petstore (2), programmatically (2), cli (2), chi (2), arguments (2), dir (2), searching (2), generalinfo (2), written (2), create (2), quiet (2), camelcase (2), containing (2), filter (2), provide (2), root (2), case (2), docker (2), build (2), install (2), quickly (2), integrate (2), utils_test (2), utils (2), swagger_test (2), spec_test (2), spec (2), schema_test (2), parsergopackages (2), parser_test (2), packages_test (2), operation_test (2), golist_test (2), golist (2), sum (2), mod (2), generics_test (2), formatter_test (2), field_parser_test (2), field_parser (2), enums_test (2), readme_zh (2), readme_pt (2), pull_request_template (2), makefile (2), dockerfile (2), code_of_conduct (2), goreleaser (2), yml (2), gitignore (2), testdata (2), gen (2), assets (2), 903 (2), commits (2), last (2), menu (2), quality (2), projects (2), discussions (2), appearance (2), cancel (2), searches (2), repositories (2), business (2), advanced (2), developer (2), customer (2), services (2), devops (2), perform, share, personal, cookies, privacy, inc, languages, jan, rc5, report, watching, 166, watchers, activity, swagger2, golang, becoming, logo, link, website, thank, backer, thanks, people, who, inspired, simplified, creative, commons, licensing, tenntenn, stickers, yvasiyarov, dependencies, flags, right, left, properly, contain, most, likely, fail, these, templates, 1177, 980, responsewriter, getposts, genericinnertype, 204, anotherone, should, complete, generates, specification, three, descending, ascending, sort, answers, questions, quiz, consts, thirdclass, third, rules, apply, above, firstclass, harddifficulty, mediumdifficulty, manually, firebase, administrative, resp, ignored, rendered, full, prevent, problems, define, directives, beginning, don, passing, mapping, tell, place, wherever, appears, present, current, mybinding, certicatekeypair, 379, big, float, prim_type, register_time, registertime, simply, parseint, unmarshaljson, appendint, marshaljson, implement, encoding, marshaler, handles, starting, writes, 708, rfc822, subject, testmail, nbody, photo_urls, photourls, location, deep, level, data4, data3, objects, nested, responsefield, requestfield, declare, structs, follow, convention, forth, spanning, either, routes, definitions, uniqueitems, minitems, maxitems, pattern, future, corresponds, instead, single, instance, pipe, tbar, space, extending, previously, mentioned, further, formats, multipleof, none, count, control, per, might, supplied, client, meaning, unlike, conform, option, validate, qux, random, enumnumber, enumint, enumstring, protects, endpoints, hoge, authorize, authorization, oauth2accesscode, oauth2password, oauth2implicit, uploading, bool, float32, uint32, uint64, vnd, multipart, mpfd, alias, match, besides, aliases, endpoint, given, codesample, deprecatedrouter, definition, httpmethod, mandatory, what, does, commas, identify, among, load, verbose, explanation, behavior, tagname, needed, parses, parsed, insufficient, things, transfer, protocol, served, serving, person, organization, pointing, exposed, service, best, cool, grouping, upload, adding, keys, responses, lists, due, indenting, tabs, allowed, standard, formatted, result, browse, documents, shown, below, index, accountsall, accountone, statusbadrequest, atoi, serve, additionally, dynamically, exports, variable, uploadaccountimage, updateaccount, deleteaccount, delete, addaccount, newcontroller, embed, finish, steps, hertz, atreugo, fiber, flamingo, gorilla, mux, buffalo, echo, logger, propertystrategy, property, strategy, snakecase, pascalcase, parsevendor, parsedependencylevel, pdl, enhancement, models, markdownfiles, codeexamplefiles, cef, codesamples, generatedtime, timestamp, top, parsedepth, depth, requiredbydefault, instancename, parsegolist, special, prefixed, character, excluded, templatedelims, leftdelim, rightdelim, initial, parsefuncbody, within, functions, machine, hoststate, vendor, upgrade, module, sure, configuration, gets, live, let, know, contains, download, pre, compiled, binary, release, ghcr, pwd, alternatively, newer, generic, contents, converts, created, plugins, popular, allows, português, 简体中文, english, history, date, folders, branches, master, additional, 401, star, fork, notification, notifications, public, dismiss, alert, switched, out, resetting, focus, qualifiers, submit, contacted, every, piece, input, very, seriously, syntax, tips, clear, users, jump, pricing, premium, ons, powered, collections, trending, archive, program, accelerator, maintainer, lab, programs, fund, developers, partners, trust, center, forum, skills, ebooks, reports, events, webinars, stories, software, development, topic, industries, government, manufacturing, financial, healthcare, industry, cases, devsecops, modernization, nonprofits, startups, small, teams, enterprises, company, size, marketplace, changelog, blog, why, stop, leaks, before, they, secret, protection, secure, fix, vulnerabilities, changes, review, plan, track, instant, dev, environments, codespaces, automate, workflow, workflows, mcp, registry, direct, agents, issue, merge, better, creation, toggle, content,
Text of the page (random words):
rsion 1 0 docs swaggerinfo host petstore swagger io docs swaggerinfo basepath v2 docs swaggerinfo schemes string http https r gin new use ginswagger middleware to serve the api docs r get swagger any ginswagger wraphandler swaggerfiles handler r run add api operation annotations in controller code package controller import fmt net http strconv github com gin gonic gin github com swaggo swag example celler httputil github com swaggo swag example celler model showaccount godoc summary show an account description get string by id tags accounts accept json produce json param id path int true account id success 200 object model account failure 400 object httputil httperror failure 404 object httputil httperror failure 500 object httputil httperror router accounts id get func c controller showaccount ctx gin context id ctx param id aid err strconv atoi id if err nil httputil newerror ctx http statusbadrequest err return account err model accountone aid if err nil httputil newerror ctx http statusnotfound err return ctx json http statusok account listaccounts godoc summary list accounts description get accounts tags accounts accept json produce json param q query string false name search by q format email success 200 array model account failure 400 object httputil httperror failure 404 object httputil httperror failure 500 object httputil httperror router accounts get func c controller listaccounts ctx gin context q ctx request url query get q accounts err model accountsall q if err nil httputil newerror ctx http statusnotfound err return ctx json http statusok accounts swag init run your app and browse to http localhost 8080 swagger index html you will see swagger 2 0 api documents as shown below the swag formatter the swag comments can be automatically formatted just like go fmt find the result of formatting here usage swag fmt exclude folder swag fmt d exclude internal when using swag fmt you need to ensure that you have a doc comment for the function to ensure correct formatting this is due to swag fmt indenting swag comments with tabs which is only allowed after a standard doc comment for example use listaccounts lists all existing accounts summary list accounts description get accounts tags accounts accept json produce json param q query string false name search by q format email success 200 array model account failure 400 object httputil httperror failure 404 object httputil httperror failure 500 object httputil httperror router accounts get func c controller listaccounts ctx gin context implementation status swagger 2 0 document basic structure api host and base path paths and operations describing parameters describing request body describing responses mime types authentication basic authentication api keys adding examples file upload enums grouping operations with tags swagger extensions declarative comments format general api info example celler main go annotation description example title required the title of the application title swagger example api version required provides the version of the application api version 1 0 description a short description of the application description this is a sample server celler server tag name name of a tag tag name this is the name of the tag tag description description of the tag tag description cool description tag docs url url of the external documentation of the tag tag docs url https example com tag docs description description of the external documentation of the tag tag docs description best example documentation termsofservice the terms of service for the api termsofservice http swagger io terms contact name the contact information for the exposed api contact name api support contact url the url pointing to the contact information must be in the format of a url contact url http www swagger io support contact email the email address of the contact person organization must be in the format of an email address contact email support swagger io license name required the license name used for the api license name apache 2 0 license url a url to the license used for the api must be in the format of a url license url http www apache org licenses license 2 0 html host the host name or ip serving the api host localhost 8080 basepath the base path on which the api is served basepath api v1 accept a list of mime types the apis can consume note that accept only affects operations with a request body such as post put and patch value must be as described under mime types accept json produce a list of mime types the apis can produce value must be as described under mime types produce json query collection format the default collection array param format in query enums csv multi pipes tsv ssv if not set csv is the default query collection format multi schemes the transfer protocol for the operation that separated by spaces schemes http https externaldocs description description of the external document externaldocs description openapi externaldocs url url of the external document externaldocs url https swagger io resources open api x name the extension key must be start by x and take only json value x example key key value using markdown descriptions when a short string in your documentation is insufficient or you need images code examples and things like that you may want to use markdown descriptions in order to use markdown descriptions use the following annotations annotation description example title required the title of the application title swagger example api version required provides the version of the application api version 1 0 description markdown a short description of the application parsed from the api md file this is an alternative to description description markdown no value needed this parses the description from api md tag name name of a tag tag name this is the name of the tag tag description markdown description of the tag this is an alternative to tag description the description will be read from a file named like tagname md tag description markdown tag x name the extension key must be start by x and take only string value x example key value api operation example celler controller annotation description description a verbose explanation of the operation behavior description markdown a short description of the application the description will be read from a file e g description markdown details will load details md id a unique string used to identify the operation must be unique among all api operations tags a list of tags to each api operation that separated by commas summary a short summary of what the operation does accept a list of mime types the apis can consume note that accept only affects operations with a request body such as post put and patch value must be as described under mime types produce a list of mime types the apis can produce value must be as described under mime types param parameters that separated by spaces param name param type data type is mandatory comment attribute optional security security to each api operation success success response that separated by spaces return code or default param type data type comment failure failure response that separated by spaces return code or default param type data type comment response as same as success and failure header header in response that separated by spaces return code param type data type comment router path definition that separated by spaces path httpmethod deprecatedrouter as same as router but deprecated x name the extension key must be start by x and take only json value x codesample optional markdown usage take file as parameter this will then search for a file named like the summary in the given folder deprecated mark endpoint as deprecated mime types swag accepts all mime types which are in the correct format that is match besides that swag also accepts aliases for some mime types as follows alias mime type json application json xml text xml plain text plain html text html mpfd multipart form data x www form urlencoded application x www form urlencoded json api application vnd api json json stream application x json stream octet stream application octet stream png image png jpeg image jpeg gif image gif event stream text event stream param type query path header body formdata data type string string integer int uint uint32 uint64 number float32 boolean bool file param data type when uploading user defined struct security annotation description parameters example securitydefinitions basic basic auth securitydefinitions basic basicauth securitydefinitions apikey api key auth in name description securitydefinitions apikey apikeyauth securitydefinitions oauth2 application oauth2 application auth tokenurl scope description securitydefinitions oauth2 application oauth2application securitydefinitions oauth2 implicit oauth2 implicit auth authorizationurl scope description securitydefinitions oauth2 implicit oauth2implicit securitydefinitions oauth2 password oauth2 password auth tokenurl scope description securitydefinitions oauth2 password oauth2password securitydefinitions oauth2 accesscode oauth2 access code auth tokenurl authorizationurl scope description securitydefinitions oauth2 accesscode oauth2accesscode parameters annotation example in in header name name authorization tokenurl tokenurl https example com oauth token authorizationurl authorizationurl https example com oauth authorize scope hoge scope write grants write access description description oauth protects our entity endpoints attribute param enumstring query string false string enums enums a b c param enumint query int false int enums enums 1 2 3 param enumnumber query number false int enums enums 1 1 1 2 1 3 param string query string false string valid minlength 5 maxlength 10 param int query int false int valid minimum 1 maximum 10 param default query string false string default default a param example query string false string example example string param collection query string false string collection collectionformat multi param extensions query string false string collection extensions x example test x nullable it also works for the struct fields type foo struct bar string minlength 4 maxlength 16 example random string baz int minimum 10 maximum 20 default 15 qux string enums foo bar baz available field name type description validate string determines the validation for the parameter possible values are required optional json string json tag options the omitempty option will mark the field as not required default declares the value of the parameter that the server will use if none is provided for example a count to control the number of results per page might default to 100 if not supplied by the client in the request note default has no meaning for required parameters see https tools ietf org html draft fge json schema validation 00 section 6 2 unlike json schema this value must conform to the defined type for this parameter maximum number see https tools ietf org html draft fge json schema validation 00 section 5 1 2 minimum number see https tools ietf org html draft fge json schema validation 00 section 5 1 3 multipleof number see https tools ietf org html draft fge json schema validation 00 section 5 1 1 maxlength integer see https tools ietf org html draft fge json schema validation 00 section 5 2 1 minlength integer see https tools ietf org html draft fge json schema validation 00 section 5 2 2 enums see https tools ietf org html draft fge json schema validation 00 section 5 5 1 format string the extending format for the previously mentioned type see data type formats for further details collectionformat string determines the format of the array if type array is used possible values are csv comma separated values foo bar ssv space separated values foo bar tsv tab separated values foo tbar pipes pipe separated values foo bar multi corresponds to multiple parameter instances instead of multiple values for a single instance foo bar foo baz this is valid only for parameters in query or formdata default value is csv example declares the example for the parameter value extensions string add extension to parameters future field name type description pattern string see https tools ietf org html draft fge json schema validation 00 section 5 2 3 maxitems integer see https tools ietf org html draft fge json schema validation 00 section 5 3 2 minitems integer see https tools ietf org html draft fge json schema validation 00 section 5 3 3 uniqueitems boolean see https tools ietf org html draft fge json schema validation 00 section 5 3 4 examples descriptions over multiple lines you can add descriptions spanning multiple lines in either the general api description or routes definitions like so description this is the first line description this is the second line description and so forth user defined structure with an array type success 200 array model account this is a user defined struct package model type account struct id int json id example 1 name string json name example account name function scoped struct declaration you can declare your request response structs inside a function body you must have to follow the naming convention package name function name struct name package main param request body main myhandler request true query params success 200 object main myhandler response router test post func myhandler type request struct requestfield string type response struct responsefield string model composition in response jsonresult s data field will be overridden by the specific type proto order success 200 object jsonresult jsonresult data proto order desc type jsonresult struct code int json code message string json message data interface json data type order struct in proto package id uint json id data interface json data also support array of objects and primitive types as nested response success 200 object jsonresult jsonresult data proto order desc success 200 object jsonresult jsonresult data string desc success 200 object jsonresult jsonresult data string desc overriding multiple fields field will be added if not exists success 200 object jsonresult jsonresult data1 string data2 string data3 proto order data4 proto order desc overriding deep level fields type deepobject struct in proto package success 200 object jsonresult jsonresult data1 proto order data proto deepobject data2 proto order data proto deepobject desc add request headers param x myheader header string true myheader must be set for valid response param x api version header string true api version eg 1 0 add response headers success 200 string string ok failure 400 string string error response default string string other error header 200 string location entity 1 header 200 400 default string token token header all string token2 token2 use multiple path params param group_id path int true group id param account_id path int true account id router examples groups group_id accounts account_id get add multiple paths param group_id path int tr...
|