标签: surveyjs

如何在 OpenApi/Swagger/YAML 中使用保留关键字命名属性

鉴于已经存在一个特殊的“type”属性,它是一个保留关键字,有什么方法可以命名自定义属性“type”。

components:  
  schemas:  
  element:  
  type: object 
  properties:  
    name:  
      type: string  #type here is the keyword
    type: #type here is the actual name of the property!
      type: string
        enum:
          - radiogroup
          - checkbox
Run Code Online (Sandbox Code Playgroud)

无法修改生成 JSON 消息的后端系统来重命名属性。谢谢。

yaml swagger openapi surveyjs

5
推荐指数
1
解决办法
3302
查看次数

将surveyjs结果发送到API

我正在尝试将surveyjs 结果发送到我的API。

在mounted() 中,我提出一个GET请求vue-resource,从我的dB 那里得到问题,然后设置surveyjs。为了发送结果,我尝试this.$http.post在surveyJSonComplete函数中使用 , 但我得到了Cannot read property 'post' of undefined. 另外,我试图将手表放在result变量上,但没有用。

mounted() {
    this.$http
      .get("myAPI")
      .then(res => res.json())
      .then(questions => {
        this.questions = questions;
        this.survey = new SurveyVue.Model(this.questions.pesquisa);
        this.survey.locale = "pt";

        this.survey.onComplete.add(function(survey) {
          this.result = survey.data;
          this.$http
          .post(
            `myAPI`,
            this.result,
            { headers: { "Content-Type": "application/json" } }
          )
          .then(response => {
            console.log(response);
            UIkit.notification({
              message: "Success",
              pos: "top-center",
              status: "success"
            });
          })
          .catch(error => {
            console.log(error);
            UIkit.notification({ …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vue-resource surveyjs

4
推荐指数
1
解决办法
1039
查看次数

标签 统计

surveyjs ×2

javascript ×1

openapi ×1

swagger ×1

vue-resource ×1

vue.js ×1

yaml ×1