Skip to content

Commit

Permalink
Fixes and testing of NSwag features
Browse files Browse the repository at this point in the history
  • Loading branch information
gluschenko committed Jul 31, 2022
1 parent 6bcee99 commit 6ab7aa5
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 24 deletions.
13 changes: 10 additions & 3 deletions src/Wishmaster.ViewModels/AppDataViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections.Generic;

namespace Wishmaster.ViewModels
{
public class AppDataViewModel
{
public IEnumerable<NavLinkViewModel>? SidebarNavigation { get; set; }
public NotViewModels.Test? Item { get; set; }
}

public class NavLinkViewModel
Expand All @@ -21,3 +20,11 @@ public NavLinkViewModel(string text, string url)
}
}
}

namespace Wishmaster.NotViewModels
{
public class Test
{
public string? Text { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,28 @@
import * as dayjs from 'dayjs';


export enum TestEnum {
A = 1,
B = 2,
export interface AppDataViewModel {
sidebarNavigation?: NavLinkViewModel[] | null;
item?: Test | null;
}

export interface SpaceItemViewModel {
Uid: string;
Name?: string | null;
IsChosen: boolean;
Description?: string | null;
export interface NavLinkViewModel {
text: string;
url: string;
}

export interface NavLinkViewModel {
Text: string;
Url: string;
export interface Test {
text?: string | null;
}

export interface AppDataViewModel {
SidebarNavigation?: NavLinkViewModel[] | null;
export interface SpaceItemViewModel {
uid: string;
name?: string | null;
isChosen: boolean;
description?: string | null;
}

export enum TestEnum {
A = 1,
B = 2,
}
13 changes: 5 additions & 8 deletions src/Wishmaster/models.nswag
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
"documentGenerator": {
"typesToOpenApi": {
"classNames": [
"Wishmaster.ViewModels.TestEnum",
"Wishmaster.ViewModels.SpaceItemViewModel",
"Wishmaster.ViewModels.NavLinkViewModel",
"Wishmaster.ViewModels.AppDataViewModel"
"Wishmaster.ViewModels.*"
],
"defaultPropertyNameHandling": "Default",
"defaultPropertyNameHandling": "CamelCase",
"defaultReferenceTypeNullHandling": "Null",
"defaultDictionaryValueReferenceTypeNullHandling": "NotNull",
"defaultEnumHandling": "Integer",
Expand All @@ -25,7 +22,7 @@
"outputType": "Swagger2",
"newLineBehavior": "Auto",
"assemblyPaths": [
"../Wishmaster.ViewModels/bin/Debug/net6.0/Wishmaster.ViewModels.dll"
"../Wishmaster.ViewModels/bin/$(Configuration)/net6.0/Wishmaster.ViewModels.dll"
],
"assemblyConfig": null,
"referencePaths": [],
Expand All @@ -47,7 +44,7 @@
"rxJsVersion": 6.0,
"dateTimeType": "DayJS",
"nullValue": "Null",
"generateClientClasses": true,
"generateClientClasses": false,
"generateClientInterfaces": false,
"generateOptionalParameters": false,
"exportTypes": true,
Expand Down Expand Up @@ -93,7 +90,7 @@
"enumNameGeneratorType": null,
"serviceHost": null,
"serviceSchemes": null,
"output": "client-app/src/models/index.ts",
"output": "client-app/src/models.ts",
"newLineBehavior": "Auto"
}
}
Expand Down

0 comments on commit 6ab7aa5

Please # to comment.