Open dylanvdmerwe opened 3 years ago
Sorry for a support issue. I did not even know that templates were a thing in nswag.
Unfortunately after pointing to your templates, I just get the following added to the bottom of my codegen ts file:
See my nswag.json file below that I run from the command line. nswag run nswag.json /runtime:Net50
nswag run nswag.json /runtime:Net50
Not quite sure what is going on.
{ "runtime": "Net50", "defaultVariables": null, "documentGenerator": { "aspNetCoreToOpenApi": { "project": "WebService.SiteApi.csproj", "msBuildProjectExtensionsPath": null, "configuration": null, "runtime": null, "targetFramework": null, "noBuild": false, "verbose": true, "workingDirectory": null, "requireParametersWithoutDefault": false, "apiGroupNames": null, "defaultPropertyNameHandling": "Default", "defaultReferenceTypeNullHandling": "Null", "defaultDictionaryValueReferenceTypeNullHandling": "NotNull", "defaultResponseReferenceTypeNullHandling": "NotNull", "defaultEnumHandling": "Integer", "flattenInheritanceHierarchy": false, "generateKnownTypes": true, "generateEnumMappingDescription": false, "generateXmlObjects": false, "generateAbstractProperties": false, "generateAbstractSchemas": true, "ignoreObsoleteProperties": false, "allowReferencesWithProperties": false, "excludedTypeNames": [], "serviceHost": null, "serviceBasePath": null, "serviceSchemes": [], "infoTitle": "My Title", "infoDescription": null, "infoVersion": "1.0.0", "documentTemplate": null, "documentProcessorTypes": [], "operationProcessorTypes": [], "typeNameGeneratorType": null, "schemaNameGeneratorType": null, "contractResolverType": null, "serializerSettingsType": null, "useDocumentProvider": true, "documentName": "v1", "aspNetCoreEnvironment": null, "createWebHostBuilderMethod": null, "startupType": null, "allowNullableBodyParameters": true, "output": null, "outputType": "Swagger2", "assemblyPaths": [], "assemblyConfig": null, "referencePaths": [], "useNuGetCache": false } }, "codeGenerators": { "openApiToTypeScriptClient": { "className": "{controller}Service", "moduleName": "", "namespace": "", "typeScriptVersion": 2.7, "template": "Angular", "promiseType": "Promise", "httpClass": "HttpClient", "useSingletonProvider": false, "injectionTokenType": "InjectionToken", "rxJsVersion": 6.0, "dateTimeType": "String", "nullValue": "Undefined", "generateClientClasses": true, "generateClientInterfaces": false, "generateOptionalParameters": false, "exportTypes": true, "wrapDtoExceptions": false, "exceptionClass": "ApiServiceException", "clientBaseClass": "ServiceBase", "wrapResponses": false, "wrapResponseMethods": [], "generateResponseClasses": true, "responseClass": "SwaggerResponse", "protectedMethods": [], "configurationClass": null, "useTransformOptionsMethod": true, "useTransformResultMethod": true, "generateDtoTypes": true, "operationGenerationMode": "MultipleClientsFromOperationId", "markOptionalProperties": false, "generateCloneMethod": false, "typeStyle": "Class", "classTypes": [], "extendedClasses": [], "extensionCode": "../../WebsiteProjects/Website.Site/wunderlust-app/src/app/providers/eightysix-api/api-service.extensions.ts", "generateDefaultValues": false, "excludedTypeNames": [], "excludedParameterNames": [], "handleReferences": false, "generateConstructorInterface": false, "convertConstructorInterfaceData": false, "importRequiredTypes": true, "useGetBaseUrlMethod": false, "baseUrlTokenName": "API_BASE_URL", "queryNullValue": "", "inlineNamedDictionaries": false, "inlineNamedAny": false, "templateDirectory": "./NswagTemplates", "typeNameGeneratorType": null, "propertyNameGeneratorType": null, "enumNameGeneratorType": null, "serviceHost": null, "serviceSchemes": null, "output": "../../WebsiteProjects/Website.Site/wunderlust-app/src/app/providers/eightysix-api/data-service.generated.ts" } } }
Hi @dylanvdmerwe did you try cloning the entire repository and running dotnet build to see if the sample works? I have never tried using these templates with a nswag json configuration.
dotnet build
Sorry for a support issue. I did not even know that templates were a thing in nswag.
Unfortunately after pointing to your templates, I just get the following added to the bottom of my codegen ts file:
See my nswag.json file below that I run from the command line.
nswag run nswag.json /runtime:Net50
Not quite sure what is going on.