You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
14 KiB
JavaScript

"use strict";(self.webpackChunkfurion=self.webpackChunkfurion||[]).push([[9625],{2494:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>o,contentTitle:()=>d,default:()=>x,frontMatter:()=>r,metadata:()=>l,toc:()=>t});var c=i(5893),s=i(1151);const r={id:"specificationdocumentsettings",title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",sidebar_label:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e"},d=void 0,l={id:"settings/specificationdocumentsettings",title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",description:"\u5982\u9700\u7f16\u5199\u914d\u7f6e\u7684\u65f6\u5019\u63d0\u4f9b\u667a\u80fd\u63d0\u793a\u548c\u6821\u9a8c\uff0c\u53ef\u67e5\u770b \u30102.7 JSON Schema \u4f7f\u7528\u3011",source:"@site/docs/settings/specificationdocumentsettings.mdx",sourceDirName:"settings",slug:"/settings/specificationdocumentsettings",permalink:"/docs/settings/specificationdocumentsettings",draft:!1,unlisted:!1,editUrl:"https://gitee.com/dotnetchina/Furion/tree/v4/handbook/docs/settings/specificationdocumentsettings.mdx",tags:[],version:"current",lastUpdatedBy:"\u767e\u5c0f\u50e7",lastUpdatedAt:1688632570,formattedLastUpdatedAt:"Jul 6, 2023",frontMatter:{id:"specificationdocumentsettings",title:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e",sidebar_label:"7. \u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e"},sidebar:"settings",previous:{title:"6. \u53cb\u597d\u5f02\u5e38\u914d\u7f6e",permalink:"/docs/settings/friendlyexceptionsettings"},next:{title:"8. \u591a\u8bed\u8a00\u914d\u7f6e",permalink:"/docs/settings/localizationsettings"}},o={},t=[{value:"7.1 \u5173\u4e8e\u914d\u7f6e",id:"71-\u5173\u4e8e\u914d\u7f6e",level:2},{value:"7.2 \u914d\u7f6e\u4fe1\u606f",id:"72-\u914d\u7f6e\u4fe1\u606f",level:2},{value:"7.3 \u914d\u7f6e\u793a\u4f8b",id:"73-\u914d\u7f6e\u793a\u4f8b",level:2}];function h(e){const n={a:"a",admonition:"admonition",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,s.a)(),...e.components};return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(n.admonition,{title:"\u914d\u7f6e\u667a\u80fd\u63d0\u793a\u548c\u6821\u9a8c",type:"tip",children:[(0,c.jsxs)(n.p,{children:["\u5982\u9700\u7f16\u5199\u914d\u7f6e\u7684\u65f6\u5019\u63d0\u4f9b\u667a\u80fd\u63d0\u793a\u548c\u6821\u9a8c\uff0c\u53ef\u67e5\u770b \u3010",(0,c.jsx)(n.a,{href:"../jsonschema",children:"2.7 JSON Schema \u4f7f\u7528"}),"\u3011"]}),(0,c.jsxs)(n.p,{children:["\u53ea\u9700\u8981\u5728 ",(0,c.jsx)(n.code,{children:".json"})," \u6587\u4ef6\u5934\u90e8\u6dfb\u52a0\u4e0b\u5217\u914d\u7f6e\u5373\u53ef\uff1a"]}),(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers {2}",children:'{\r\n "$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json"\r\n}\n'})})]}),"\n",(0,c.jsx)(n.h2,{id:"71-\u5173\u4e8e\u914d\u7f6e",children:"7.1 \u5173\u4e8e\u914d\u7f6e"}),"\n",(0,c.jsxs)(n.p,{children:["\u89c4\u8303\u5316\u6587\u6863\u914d\u7f6e\u6307\u7684\u662f ",(0,c.jsx)(n.code,{children:"Furion"})," \u6846\u67b6 Swagger \u6587\u6863\u914d\u7f6e\u9009\u9879\u3002"]}),"\n",(0,c.jsx)(n.h2,{id:"72-\u914d\u7f6e\u4fe1\u606f",children:"7.2 \u914d\u7f6e\u4fe1\u606f"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"SpecificationDocumentSettings"}),"\uff1a\u914d\u7f6e\u6839\u8282\u70b9","\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"DocumentTitle"}),"\uff1a\u6587\u6863\u6807\u9898\uff0c",(0,c.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"Specification Api Document"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"DefaultGroupName"}),"\uff1a\u9ed8\u8ba4\u5206\u7ec4\u540d\uff0c",(0,c.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"Default"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"EnableAuthorized"}),"\uff1a\u662f\u5426\u542f\u7528\u6743\u9650\u63a7\u5236\uff0c",(0,c.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"true"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"FormatAsV2"}),"\uff1a\u91c7\u7528 ",(0,c.jsx)(n.code,{children:"Swagger 2.0"})," \u7248\u672c\uff0c",(0,c.jsx)(n.code,{children:"bool"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"false"})," ",(0,c.jsx)(n.strong,{children:(0,c.jsx)(n.a,{href:"https://github.com/domaindrivendev/Swashbuckle.WebApi/issues/1393",children:"\u5df2\u5f03\u7528"})})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"RoutePrefix"}),"\uff1a\u89c4\u8303\u5316\u6587\u6863\u5730\u5740\uff0c",(0,c.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"api"}),"\uff0c",(0,c.jsx)(n.strong,{children:"\u5982\u679c\u5e0c\u671b\u5728\u9996\u9875\uff0c\u6539\u4e3a\u7a7a\u5b57\u7b26\u4e32\u5373\u53ef"}),"\u3002"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"DocExpansionState"}),"\uff1a\u6587\u6863\u663e\u793a\u65b9\u5f0f\uff0c",(0,c.jsx)(n.code,{children:"DocExpansion"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"List"}),"\uff0c\u53d6\u503c\uff1a","\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"List"}),"\uff1a\u5217\u8868\u5f0f\uff08\u5c55\u5f00\u5b50\u7c7b\uff09\uff0c",(0,c.jsx)(n.strong,{children:"\u9ed8\u8ba4\u503c"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Full"}),"\uff1a\u5b8c\u5168\u5c55\u5f00"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"None"}),"\uff1a\u5217\u8868\u5f0f\uff08\u4e0d\u5c55\u5f00\u5b50\u7c7b\uff09"]}),"\n"]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"XmlComments"}),"\uff1a\u7a0b\u5e8f\u96c6\u6ce8\u91ca\u63cf\u8ff0\u6587\u4ef6\u540d\uff08\u53ef\u5e26 ",(0,c.jsx)(n.code,{children:".xml"}),"\uff0c",(0,c.jsx)(n.code,{children:"string"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"Furion.Application, Furion.Web.Entry, Furion.Web.Core"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"GroupOpenApiInfos"}),"\uff1a\u5206\u7ec4\u4fe1\u606f\u914d\u7f6e\uff0c",(0,c.jsx)(n.code,{children:"SpecificationOpenApiInfo[]"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"{ 'Group': 'Default'}"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"SecurityDefinitions"}),"\uff1a\u5b89\u5168\u7b56\u7565\u5b9a\u4e49\u914d\u7f6e\uff0c",(0,c.jsx)(n.code,{children:"SpecificationOpenApiSecurityScheme[]"}),"\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"[]"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Servers"}),"\uff1a\u914d\u7f6e Server \u4e0b\u62c9\u5217\u8868\uff0c",(0,c.jsx)(n.code,{children:"OpenApiServer[]"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"[]"}),"\uff0c\u5982\uff1a",(0,c.jsx)(n.code,{children:'{Servers:[ { Url:"\u5730\u5740", Description:"\u63cf\u8ff0"} ]}'})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"HideServers"}),"\uff1a\u662f\u5426\u9690\u85cf Server \u4e0b\u62c9\u5217\u8868\uff0c",(0,c.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"true"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"RouteTemplate"}),"\uff1a\u914d\u7f6e\u6587\u6863 ",(0,c.jsx)(n.code,{children:"swagger.json"})," \u8def\u7531\u6a21\u677f\uff0c\u9ed8\u8ba4\u6a21\u677f\uff1a",(0,c.jsx)(n.code,{children:"swagger/{documentName}/swagger.json"}),", ",(0,c.jsx)(n.code,{children:"{documentName}"})," \u4ee3\u8868\u5206\u7ec4\u540d\uff0c",(0,c.jsx)(n.strong,{children:"\u5fc5\u987b\u4fdd\u7559\u539f\u6837"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"PackagesGroups"}),"\uff1a\u914d\u7f6e\u6a21\u5757\u5316\u5185\u7f6e\u5206\u7ec4\u540d\u79f0\uff0c",(0,c.jsx)(n.code,{children:"string[]"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"[]"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"EnableEnumSchemaFilter"}),"\uff1a\u542f\u7528\u679a\u4e3e Schema \u7b5b\u9009\u5668\uff0c",(0,c.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"true"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"EnableTagsOrderDocumentFilter"}),"\uff1a\u542f\u7528\u6807\u7b7e\u6392\u5e8f\u7b5b\u9009\u5668\uff0c",(0,c.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"true"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"ServerDir"}),"\uff1a\u914d\u7f6e ",(0,c.jsx)(n.code,{children:"IIS"})," \u6dfb\u52a0 ",(0,c.jsx)(n.code,{children:"Application"})," \u90e8\u7f72\u540d\uff0c",(0,c.jsx)(n.code,{children:"string"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4\u7a7a\uff0c",(0,c.jsx)(n.strong,{children:"\u4ec5\u5728 Furion v3.2.0+` \u6709\u6548"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"LoginInfo"}),"\uff1a\u914d\u7f6e ",(0,c.jsx)(n.code,{children:"Swagger"})," \u662f\u5426\u9700\u8981\u767b\u5f55\u624d\u80fd\u8bbf\u95ee\uff0c",(0,c.jsx)(n.code,{children:"SpecificationLoginInfo"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"null"}),"\uff0c",(0,c.jsx)(n.strong,{children:"\u4ec5\u5728 Furion v3.3.3+` \u6709\u6548"}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Enabled"}),"\uff1a\u662f\u5426\u542f\u7528\u767b\u5f55\u6388\u6743\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"false"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"CheckUrl"}),"\uff1a\u68c0\u67e5\u767b\u5f55\u72b6\u6001\u7684 ",(0,c.jsx)(n.code,{children:"Url"})," \u5730\u5740\uff0c",(0,c.jsxs)(n.strong,{children:["\u8be5\u5730\u5740\u5fc5\u987b\u662f ",(0,c.jsx)(n.code,{children:"POST"})," \u8bf7\u6c42"]})]}),"\n"]}),"\n"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"SubmitUrl"}),"\uff1a\u63d0\u4ea4\u767b\u5f55\u7684 ",(0,c.jsx)(n.code,{children:"Url"})," \u5730\u5740\uff0c",(0,c.jsxs)(n.strong,{children:["\u8be5\u5730\u5740\u5fc5\u987b\u662f ",(0,c.jsx)(n.code,{children:"POST"})," \u8bf7\u6c42\u4e14\u53ea\u6709\u4e00\u4e2a ",(0,c.jsx)(n.code,{children:"SpecificationAuth"})," \u7c7b\u578b\u53c2\u6570"]}),"\uff0c\u6210\u529f\u767b\u5f55\u8fd4\u56de ",(0,c.jsx)(n.code,{children:"200"}),"\uff0c\u5426\u5219\u8fd4\u56de ",(0,c.jsx)(n.code,{children:"401"}),"\uff0c\u652f\u6301\u76f8\u5bf9\u5730\u5740\uff0c\u4ee5 ",(0,c.jsx)(n.code,{children:"/"})," \u5f00\u5934"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"EnableAllGroups"}),"\uff1a\u542f\u7528 ",(0,c.jsx)(n.code,{children:"Swagger"})," \u603b\u5206\u7ec4\u529f\u80fd\uff0c\u81ea\u52a8\u5c06\u6240\u6709\u5206\u7ec4\u7684\u63a5\u53e3\u5408\u5e76\u5230 ",(0,c.jsx)(n.code,{children:"All Groups"})," \u4e2d\uff0c",(0,c.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"false"}),"\uff0c",(0,c.jsx)(n.strong,{children:"\u4ec5\u5728 Furion v3.3.4+` \u6709\u6548"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"EnumToNumber"}),"\uff1a\u679a\u4e3e\u7c7b\u578b\u751f\u6210\u503c\u7c7b\u578b\uff0c",(0,c.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"false"}),"\uff0c",(0,c.jsx)(n.strong,{children:"\u4ec5\u5728 Furion 4.8.8.35+` \u6709\u6548"})]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,c.jsxs)(n.p,{children:["\u53e6\u5916 ",(0,c.jsx)(n.code,{children:"SpecificationOpenApiInfo"})," \u5185\u7f6e\u914d\u7f6e\u5982\u4e0b\uff1a"]}),"\n",(0,c.jsxs)(n.ul,{children:["\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Group"}),"\uff1a\u5206\u7ec4\u552f\u4e00\u6807\u8bc6\uff0c",(0,c.jsx)(n.code,{children:"string"})," \u7c7b\u578b\uff0c\u5fc5\u586b"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Order"}),"\uff1a\u5206\u7ec4\u6392\u5e8f\uff0c",(0,c.jsx)(n.code,{children:"int"})," \u7c7b\u578b\uff0c\u6570\u5b57\u8d8a\u5927\u6392\u524d\u9762\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"0"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Visible"}),"\uff1a\u914d\u7f6e\u5206\u7ec4\u662f\u5426\u53ef\u89c1\uff0c",(0,c.jsx)(n.code,{children:"bool"})," \u7c7b\u578b\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"true"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Title"}),"\uff1a\u914d\u7f6e\u5206\u7ec4\u6807\u9898\uff0c",(0,c.jsx)(n.code,{children:"string"})," \u7c7b\u578b"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Description"}),"\uff1a\u914d\u7f6e\u5206\u7ec4\u63cf\u8ff0\uff0c",(0,c.jsx)(n.code,{children:"string"})," \u7c7b\u578b"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Version"}),"\uff1a\u914d\u7f6e\u5206\u7ec4\u7248\u672c\uff0c\u9ed8\u8ba4 ",(0,c.jsx)(n.code,{children:"1.0"})]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"TermsOfService"}),"\uff1a\u914d\u7f6e\u76f8\u5173\u94fe\u63a5\u5730\u5740\uff0c",(0,c.jsx)(n.code,{children:"Uri"})," \u7c7b\u578b"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"Contact"}),"\uff1a\u914d\u7f6e\u8054\u7cfb\u65b9\u5f0f\uff0c",(0,c.jsx)(n.code,{children:"OpenApiContact"})," \u7c7b\u578b"]}),"\n",(0,c.jsxs)(n.li,{children:[(0,c.jsx)(n.code,{children:"License"}),"\uff1a\u914d\u7f6e\u534f\u8bae\uff0c",(0,c.jsx)(n.code,{children:"OpenApiLicense"})," \u7c7b\u578b"]}),"\n"]}),"\n",(0,c.jsx)(n.h2,{id:"73-\u914d\u7f6e\u793a\u4f8b",children:"7.3 \u914d\u7f6e\u793a\u4f8b"}),"\n",(0,c.jsx)(n.pre,{children:(0,c.jsx)(n.code,{className:"language-json",metastring:"showLineNumbers",children:'{\r\n "SpecificationDocumentSettings": {\r\n "GroupOpenApiInfos": [\r\n {\r\n "Group": "Group1",\r\n "Title": "\u5206\u7ec4\u6807\u9898",\r\n "Description": "\u8fd9\u91cc\u662f\u5206\u7ec4\u63cf\u8ff0",\r\n "Version": "\u7248\u672c\u53f7",\r\n "TermsOfService": "http://furion.baiqian.ltd",\r\n "Contact": {\r\n "Name": "\u767e\u5c0f\u50e7",\r\n "Url": "https://gitee.com/monksoul",\r\n "Email": "monksoul@outlook.com"\r\n },\r\n "License": {\r\n "Name": "MIT",\r\n "Url": "https://gitee.com/dotnetchina/Furion/blob/alpha/LICENSE"\r\n }\r\n }\r\n ]\r\n }\r\n}\n'})})]})}function x(e={}){const{wrapper:n}={...(0,s.a)(),...e.components};return n?(0,c.jsx)(n,{...e,children:(0,c.jsx)(h,{...e})}):h(e)}},1151:(e,n,i)=>{i.d(n,{Z:()=>l,a:()=>d});var c=i(7294);const s={},r=c.createContext(s);function d(e){const n=c.useContext(r);return c.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:d(e.components),c.createElement(r.Provider,{value:n},e.children)}}}]);