1
0
mirror of https://github.com/bitwarden/server synced 2025-12-14 15:23:42 +00:00

[PM-2196] Improvements to the Swagger generator (#2914)

* Swagger fixes

Co-Authored-By: Oscar Hinton <Hinton@users.noreply.github.com>

* Make Response Models return Guids instead of strings

* Change strings into guids in ScimApplicationFactory

---------

Co-authored-by: Oscar Hinton <Hinton@users.noreply.github.com>
This commit is contained in:
Daniel García
2023-07-14 17:18:26 +02:00
committed by GitHub
parent 966614c7e2
commit 4f87e4e1a4
41 changed files with 209 additions and 217 deletions

View File

@@ -18,7 +18,7 @@ public class CipherMiniResponseModel : ResponseModel
throw new ArgumentNullException(nameof(cipher));
}
Id = cipher.Id.ToString();
Id = cipher.Id;
Type = cipher.Type;
CipherData cipherData;
@@ -57,7 +57,7 @@ public class CipherMiniResponseModel : ResponseModel
Fields = cipherData.Fields?.Select(f => new CipherFieldModel(f));
PasswordHistory = cipherData.PasswordHistory?.Select(ph => new CipherPasswordHistoryModel(ph));
RevisionDate = cipher.RevisionDate;
OrganizationId = cipher.OrganizationId?.ToString();
OrganizationId = cipher.OrganizationId;
Attachments = AttachmentResponseModel.FromCipher(cipher, globalSettings);
OrganizationUseTotp = orgUseTotp;
CreationDate = cipher.CreationDate;
@@ -65,8 +65,8 @@ public class CipherMiniResponseModel : ResponseModel
Reprompt = cipher.Reprompt.GetValueOrDefault(CipherRepromptType.None);
}
public string Id { get; set; }
public string OrganizationId { get; set; }
public Guid Id { get; set; }
public Guid? OrganizationId { get; set; }
public CipherType Type { get; set; }
public dynamic Data { get; set; }
public string Name { get; set; }
@@ -90,13 +90,13 @@ public class CipherResponseModel : CipherMiniResponseModel
public CipherResponseModel(CipherDetails cipher, IGlobalSettings globalSettings, string obj = "cipher")
: base(cipher, globalSettings, cipher.OrganizationUseTotp, obj)
{
FolderId = cipher.FolderId?.ToString();
FolderId = cipher.FolderId;
Favorite = cipher.Favorite;
Edit = cipher.Edit;
ViewPassword = cipher.ViewPassword;
}
public string FolderId { get; set; }
public Guid? FolderId { get; set; }
public bool Favorite { get; set; }
public bool Edit { get; set; }
public bool ViewPassword { get; set; }