@travetto/openapi 7.0.0-rc.1 → 7.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/openapi",
3
- "version": "7.0.0-rc.1",
3
+ "version": "7.0.0-rc.2",
4
4
  "description": "OpenAPI integration support for the Travetto framework",
5
5
  "keywords": [
6
6
  "web",
@@ -26,14 +26,14 @@
26
26
  "directory": "module/openapi"
27
27
  },
28
28
  "dependencies": {
29
- "@travetto/config": "^7.0.0-rc.0",
30
- "@travetto/schema": "^7.0.0-rc.0",
31
- "@travetto/web": "^7.0.0-rc.1",
29
+ "@travetto/config": "^7.0.0-rc.1",
30
+ "@travetto/schema": "^7.0.0-rc.1",
31
+ "@travetto/web": "^7.0.0-rc.2",
32
32
  "openapi3-ts": "^4.5.0",
33
33
  "yaml": "^2.8.1"
34
34
  },
35
35
  "peerDependencies": {
36
- "@travetto/cli": "^7.0.0-rc.0"
36
+ "@travetto/cli": "^7.0.0-rc.1"
37
37
  },
38
38
  "peerDependenciesMeta": {
39
39
  "@travetto/cli": {
@@ -48,7 +48,7 @@ export class OpenapiVisitor implements ControllerVisitor<GeneratedSpec> {
48
48
  throw new AppError(`Unknown class, not registered as a schema: ${input.type.Ⲑid}`);
49
49
  }
50
50
 
51
- const fields = SchemaRegistryIndex.getFieldMap(input.type, input.view);
51
+ const fields = SchemaRegistryIndex.get(input.type).getFields(input.view);
52
52
  const params: ParameterObject[] = [];
53
53
  for (const sub of Object.values(fields)) {
54
54
  const name = sub.name.toString();
@@ -243,7 +243,7 @@ export class OpenapiVisitor implements ControllerVisitor<GeneratedSpec> {
243
243
  description: 'Raw binary data'
244
244
  };
245
245
  } else {
246
- const schemaConfig = SchemaRegistryIndex.getOptionalConfig(body.type);
246
+ const schemaConfig = SchemaRegistryIndex.getOptional(body.type)?.get();
247
247
  const typeId = schemaConfig ? this.#nameResolver.getName(schemaConfig) : body.type.name;
248
248
  const typeRef = schemaConfig ? this.#getType(body.type) : { type: body.type.name.toLowerCase() };
249
249
  return {
@@ -298,7 +298,7 @@ export class OpenapiVisitor implements ControllerVisitor<GeneratedSpec> {
298
298
 
299
299
  const tagName = ctrl.externalName;
300
300
 
301
- const schema = SchemaRegistryIndex.getMethodConfig(ep.class, ep.methodName);
301
+ const schema = SchemaRegistryIndex.get(ep.class).getMethod(ep.methodName);
302
302
 
303
303
  const op: OperationObject = {
304
304
  tags: [tagName],
@@ -314,7 +314,7 @@ export class OpenapiVisitor implements ControllerVisitor<GeneratedSpec> {
314
314
  const code = Object.keys(pConf.content).length ? 200 : 201;
315
315
  op.responses![code] = pConf;
316
316
 
317
- const methodSchema = SchemaRegistryIndex.getMethodConfig(ep.class, ep.methodName);
317
+ const methodSchema = SchemaRegistryIndex.get(ep.class).getMethod(ep.methodName);
318
318
 
319
319
  for (const param of methodSchema.parameters) {
320
320
  const result = this.#processEndpointParam(ep, ep.parameters[param.index] ?? {}, param);