github.com/rzurga/go-swagger@v0.28.1-0.20211109195225-5d1f453ffa3a/docs/generate/templates.md (about) 1 # Use custom templates 2 3 When generating a server or client you can specify a directory to load custom templates from 4 with `--template-dir`. It will recursively read all the `.gotmpl` files in the directory and 5 load them as templates. 6 7 <!--more--> 8 9 Each file will be loaded and define a template named the same as the file without the suffix. If 10 the file is in a subdirectory the directory name will be included in the template name and the 11 first character of the next path segment will be uppercased. e.g. 12 - template.gotmpl -> template 13 - server/test.gotmpl -> serverTest 14 15 You can override the following templates. Check go-swagger/generator/templates for the default 16 definitions. 17 18 # Available Templates 19 20 # Client Templates 21 22 ## clientFacade 23 Defined in `client/facade.gotmpl` 24 25 --- 26 ## clientParameter 27 Defined in `client/parameter.gotmpl` 28 29 --- 30 ## clientResponse 31 Defined in `client/response.gotmpl` 32 ####requires 33 - clientresponse 34 - schema 35 - docstring 36 37 --- 38 ## clientresponse 39 Defined in `client/response.gotmpl` 40 41 --- 42 ## clientClient 43 Defined in `client/client.gotmpl` 44 45 46 # Server Templates 47 48 ## serverParameter 49 Defined in `server/parameter.gotmpl` 50 ####requires 51 - propertyparamvalidator 52 - sliceparambinder 53 54 --- 55 ## sliceparamvalidator 56 Defined in `server/parameter.gotmpl` 57 58 --- 59 ## serverResponses 60 Defined in `server/responses.gotmpl` 61 ####requires 62 - serverresponse 63 64 --- 65 ## sliceparambinder 66 Defined in `server/parameter.gotmpl` 67 ####requires 68 - propertyparamvalidator 69 - sliceparambinder 70 71 --- 72 ## serverresponse 73 Defined in `server/responses.gotmpl` 74 75 76 --- 77 ## serverOperation 78 Defined in `server/operation.gotmpl` 79 ####requires 80 - schema 81 - docstring 82 83 --- 84 ## propertyparamvalidator 85 Defined in `server/parameter.gotmpl` 86 ####requires 87 - validationPrimitive 88 - sliceparamvalidator 89 90 --- 91 ## serverMain 92 Defined in `server/main.gotmpl` 93 94 --- 95 ## bindprimitiveparam 96 Defined in `server/parameter.gotmpl` 97 98 --- 99 ## serverConfigureapi 100 Defined in `server/configureapi.gotmpl` 101 102 --- 103 ## serverBuilder 104 Defined in `server/builder.gotmpl` 105 106 --- 107 ## serverDoc 108 Defined in `server/doc.gotmpl`