Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

'validate is not a function' error #1643

@dlapanik

Description

@dlapanik

Describe the bug
Getting error 'validate is not a function' when try to create service instance if for SFPlan definition JSON Schema draft-07 was used.

To Reproduce
Steps to reproduce the behavior:

  1. Define SFPlan with "$schema": "http://json-schema.org/draft-07/schema#"
  schemas:
    service_instance:
      create:
        parameters:
          "$schema": "http://json-schema.org/draft-07/schema#"
          title: createServiceInstance
          type: object
          additionalProperties: false
          _show_form_view: true
          properties:
            backend:
              type: string
  1. try to create service instance

Expected behavior
As soon as you are using https://ajv.js.org for JSON validation I expect that drafts 04, 06, 07, 2019-09 and 2020-12 are supported.

If by some reason you support only draft-04,-06 I expect do not see runtime error but appropriate message (better during applying SFPlan and not when somebody tries to create service instance)

Additional context
Error raised from line 243.

Bug was introduced by eb5a282.

If you follow method validateSchemaForRequest - there are branches only for schema equal draft-04,-06 and "". So if schema defined as draft-07 and code comes to line 243 validate has undefined value

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Waiting for Changes | Open for Contributions

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions