mirror of
https://github.com/unclshura/BlazorOpenApi.git
synced 2025-12-21 09:51:53 +00:00
Refactor OpenAPI usage in Razor components
Removed `@using Microsoft.OpenApi.Models` and related namespaces from various Razor component files to streamline OpenAPI model usage. Updated null checks to include opening braces for improved readability. Modified `_Imports.razor` to include new namespaces `BlazorOpenApi` and `BlazorOpenApi.Controls`, while removing outdated OpenAPI imports.
This commit is contained in:
parent
a01262ff8a
commit
a154bd9b8c
@ -1,6 +1,4 @@
|
||||
@using Microsoft.OpenApi.Any
|
||||
|
||||
@if (Value != null)
|
||||
@if (Value != null)
|
||||
{
|
||||
<div class="e-item">
|
||||
@switch (Value.AnyType)
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
@if ( Value != null )
|
||||
{
|
||||
@if (Value.Schemas?.Count > 0)
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if (Value != null)
|
||||
@if (Value != null)
|
||||
{
|
||||
<div class="descriminator">
|
||||
<Text Value="@Value.PropertyName" />
|
||||
|
||||
@ -1,7 +1,4 @@
|
||||
@using Microsoft.OpenApi.Any
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if (Value != null || Example != null )
|
||||
@if (Value != null || Example != null )
|
||||
{
|
||||
<div class="e-title">
|
||||
@if (!string.IsNullOrWhiteSpace(Name))
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
@using System.Text.Json
|
||||
@using Microsoft.OpenApi.Models
|
||||
@using Microsoft.OpenApi.Readers
|
||||
|
||||
@if (Value != null)
|
||||
@if (Value != null)
|
||||
{
|
||||
<div class="header">
|
||||
<h1 class="h-title">@Value.Title <span class="h-version">@Value.Version</span></h1>
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if (Value != null)
|
||||
{
|
||||
<div class="mt-body">
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
@using System.Text.Json
|
||||
@using Microsoft.OpenApi.Models
|
||||
@using Microsoft.OpenApi.Readers
|
||||
|
||||
@if (Value != null)
|
||||
@if (Value != null)
|
||||
{
|
||||
<div class="op-header @OperationClass" @onclick="Expand">
|
||||
<div class="op-type">@Operation</div>
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
@using System.Text.Json
|
||||
@using Microsoft.OpenApi.Models
|
||||
@using Microsoft.OpenApi.Readers
|
||||
|
||||
@if (Value != null)
|
||||
@if (Value != null)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if ( Value != null )
|
||||
@if ( Value != null )
|
||||
{
|
||||
<div class="p-style @StyleClass">@Value</div>
|
||||
}
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
@using System.Text.Json
|
||||
@using Microsoft.OpenApi.Models
|
||||
@using Microsoft.OpenApi.Readers
|
||||
|
||||
@if (Value?.Count > 0)
|
||||
@if (Value?.Count > 0)
|
||||
{
|
||||
<table class="op-params parameter">
|
||||
@foreach (var p in Value)
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
@using System.Text.Json
|
||||
@using Microsoft.OpenApi.Models
|
||||
@using Microsoft.OpenApi.Readers
|
||||
|
||||
@if (!string.IsNullOrWhiteSpace(Key) || Value != null)
|
||||
@if (!string.IsNullOrWhiteSpace(Key) || Value != null)
|
||||
{
|
||||
@if (!string.IsNullOrWhiteSpace(@Value?.Summary) || !string.IsNullOrWhiteSpace(Value?.Description))
|
||||
{
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if (Value != null)
|
||||
{
|
||||
<div class="request">
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if (ResolvedValue != null)
|
||||
{
|
||||
<div class="response">
|
||||
|
||||
@ -1,5 +1,3 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if (Value?.Count > 0)
|
||||
{
|
||||
<div class="responses">
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if ( Value != null )
|
||||
@if ( Value != null )
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
@using Microsoft.OpenApi.Models
|
||||
|
||||
@if ( ResolvedValue != null )
|
||||
@if ( ResolvedValue != null )
|
||||
{
|
||||
<table class="schema">
|
||||
<SchemaChildControl Value="@ResolvedValue" Title="@Title" Required="@Required" Collapsed="@Collapsed"/>
|
||||
|
||||
@ -1,8 +1,4 @@
|
||||
@using System.Text.Json
|
||||
@using Microsoft.OpenApi.Models
|
||||
@using Microsoft.OpenApi.Readers
|
||||
|
||||
@if (Value != null && Value.Count > 0)
|
||||
@if (Value != null && Value.Count > 0)
|
||||
{
|
||||
<h2>Servers</h2>
|
||||
<table class="servers">
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
@using System.Net.Http
|
||||
@using BlazorOpenApi
|
||||
@using BlazorOpenApi.Controls
|
||||
@using Microsoft.AspNetCore.Authorization
|
||||
@using Microsoft.AspNetCore.Components.Authorization
|
||||
@using Microsoft.AspNetCore.Components.Forms
|
||||
@ -6,5 +7,8 @@
|
||||
@using Microsoft.AspNetCore.Components.Web
|
||||
@using Microsoft.AspNetCore.Components.Web.Virtualization
|
||||
@using Microsoft.JSInterop
|
||||
@using BlazorOpenApi
|
||||
@using BlazorOpenApi.Controls
|
||||
@using Microsoft.OpenApi.Any
|
||||
@using Microsoft.OpenApi.Models
|
||||
@using Microsoft.OpenApi.Readers
|
||||
@using System.Net.Http
|
||||
@using System.Text.Json
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user