This repository was archived by the owner on Jun 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -127,9 +127,10 @@ export class ContentController {
127127 const openApiIndexBuilder = new OpenApiIndexBuilder ( ) ;
128128
129129 for ( const fileName of fileNames ) {
130+ const specKey = fileName . startsWith ( "/" ) ? fileName . substr ( 1 ) : fileName ;
130131 const filePath = path . resolve ( specsFolderPath , fileName ) ;
131132 const spec : OpenApiSpec30 = JSON . parse ( await fs . promises . readFile ( filePath , defaultFileEncoding ) ) ;
132- openApiIndexBuilder . appendSpec ( fileName , spec ) ;
133+ openApiIndexBuilder . appendSpec ( specKey , spec ) ;
133134 }
134135
135136 const searchIndex = openApiIndexBuilder . buildIndex ( ) ;
Original file line number Diff line number Diff line change @@ -19,12 +19,13 @@ export class OpenApiPublisher implements IPublisher {
1919 const downloadKeys = await this . specsBlobStorage . listBlobs ( ) ;
2020
2121 for ( const blobKey of downloadKeys ) {
22- const specContent = await this . specsBlobStorage . downloadBlob ( blobKey ) ;
22+ const specKey = blobKey . startsWith ( "/" ) ? blobKey . substr ( 1 ) : blobKey ;
23+ const specContent = await this . specsBlobStorage . downloadBlob ( specKey ) ;
2324 const openApiSpec : OpenApiSpec30 = JSON . parse ( Utils . uint8ArrayToString ( specContent ) ) ;
2425
25- openApiIndexBuilder . appendSpec ( blobKey , openApiSpec ) ;
26+ openApiIndexBuilder . appendSpec ( specKey , openApiSpec ) ;
2627
27- await this . outputBlobStorage . uploadBlob ( `/specs/${ blobKey } ` , specContent , "application/json" ) ;
28+ await this . outputBlobStorage . uploadBlob ( `/specs/${ specKey } ` , specContent , "application/json" ) ;
2829 this . logger . trackEvent ( "Publishing" , { message : `Publishing OpenAPI spec ${ openApiSpec . info . title } ...` } ) ;
2930 }
3031
You can’t perform that action at this time.
0 commit comments