export default async function addContentType()

in compiler/src/steps/add-deprecation.ts [26:49]


export default async function addContentType (model: model.Model, jsonSpec: Map<string, JsonSpec>): Promise<model.Model> {
  for (const endpoint of model.endpoints) {
    if (endpoint.deprecation != null) {
      continue
    }

    if (endpoint.request == null) {
      continue
    }

    const request = model.types.find(x => x.kind === 'request' && x.name === endpoint.request)
    if (request == null) {
      continue
    }

    if (request.deprecation == null) {
      continue
    }

    endpoint.deprecation = request.deprecation
  }

  return model
}