Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/openapi-spec-builder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"Testing"
],
"dependencies": {
"@loopback/openapi-spec": "^4.0.0-alpha.20"
"@loopback/openapi-spec-types": "^4.0.0-alpha.20"
},
"devDependencies": {
"@loopback/build": "^4.0.0-alpha.9"
Expand Down
10 changes: 7 additions & 3 deletions packages/openapi-spec-builder/src/openapi-spec-builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
ResponseObject,
ParameterObject,
createEmptyApiSpec,
} from '@loopback/openapi-spec';
} from '@loopback/openapi-spec-types';

/**
* Create a new instance of OpenApiSpecBuilder.
Expand Down Expand Up @@ -72,7 +72,7 @@ export class OpenApiSpecBuilder extends BuilderBase<OpenApiSpec> {
* @param basePath The base path on which the API is served.
*/
constructor() {
super(createEmptyApiSpec());
super(createEmptyApiSpec({}));
}

/**
Expand Down Expand Up @@ -137,7 +137,11 @@ export class OperationSpecBuilder extends BuilderBase<OperationObject> {
withStringResponse(status: number | 'default' = 200): this {
return this.withResponse(status, {
description: 'The string result.',
schema: {type: 'string'},
content: {
'*/*': {
schema: {type: 'string'},
},
},
});
}

Expand Down
3 changes: 3 additions & 0 deletions packages/openapi-spec-types/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.tgz
dist*
package
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,36 @@ See [all contributors](https://github.com/strongloop/loopback-next/graphs/contri
# License

MIT

# One repo vs multiple repo

## One repo

### Pros

- easy to extract common suger interfaces
- less packages to maintain, clearier layout to manage different versions
- if we only support one version, export types from one package, no need to update each dependant

# Items to change

- path related repos --> rest & openapi-v2 & ?
- components.schema related repo --> repository/decorators/metadata?
- update path decorator's KEY
- explain more in openapi-v2's readme
- openapi-spec-builder
-
- verification --> testlab
- shall we merge openapi-spec-builder and openapi-v2?
- fix the inconsistency caused by basePath --> servers
- check port, host

#Questions

- default server: set default port and host?
- Yes. default is required
- wrap 3000 with double quotes?

# Type validation repo

https://github.com/hanlindev/interface-validator
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"name": "@loopback/openapi-spec",
"name": "@loopback/openapi-spec-types",
"version": "4.0.0-alpha.20",
"description": "TypeScript type definitions for OpenAPI Spec/Swagger documents.",
"engines": {
"node": ">=6"
},
"dependencies": {
"openapi3-ts": "^0.6.2"
},
"devDependencies": {
"@loopback/build": "^4.0.0-alpha.9"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

export * from './openapi-spec-v2';
export * from './v3/openapi-v3-spec-types';
// export * from './v2/openapi-v2-spec-types';
Loading