小编Rab*_*lck的帖子

Springdoc Openapi - 添加响应示例值

我正在尝试将示例响应值添加到我的 springdoc-openapi swagger 文档中。

比如用“马克·吐温”替换“字符串”等。

在此输入图像描述

我尝试使用此解决方案 - springdoc-openapi: How to add example of POST request?

我已经org.springframework.web.bind.annotation.RequestBody在我的课堂上使用了。

如果我用这个 -

@io.swagger.v3.oas.annotations.parameters.RequestBody(content = @Content(examples = {
                @ExampleObject(
                        name = "Person sample",
                        summary = "person example",
                        value =
                                "{\"email\": test@gmail.Com,"
                                        + "\"firstName\": \"josh\","
                                        + "\"lastName\": \"spring...\""
                                        + "}")
        }))
Run Code Online (Sandbox Code Playgroud)

我得到以下解释 -

no viable alternative at input ',@io.swagger.v3.oas.annotations.parameters.RequestBody(content=@Content(examples={@ExampleObject(name="Person sample",summary="person example",value="{\"email\": test@gmail.Com,"+"\"firstName\": \"josh\","+"\"lastName\": \"spring...\""+"}")})))': NoViableAltException```

Can anyone give me a solution please?
Run Code Online (Sandbox Code Playgroud)

java swagger spring-boot openapi springdoc-openapi-ui

7
推荐指数
1
解决办法
6410
查看次数

Airflow DAG EMR EmrCreateJobFlowOperator 不执行任何操作

我正在尝试运行一个创建 EMR 集群的 Airflow dag,添加一些步骤,检查它们并最终终止创建的 EMR 集群。但是当我运行 Airflow Dag 时,它持续处于运行状态,并且不显示任何错误或日志。

谁能告诉我我在这里做错了什么?是否有任何我应该添加的缺失参数?或者这是 dag 时间表的问题?

import airflow
from airflow import DAG
from airflow.contrib.operators.emr_create_job_flow_operator import 
EmrCreateJobFlowOperator
from airflow.contrib.operators.emr_add_steps_operator import 
EmrAddStepsOperator
from airflow.contrib.sensors.emr_step_sensor import EmrStepSensor
from airflow.contrib.operators.emr_terminate_job_flow_operator import 
EmrTerminateJobFlowOperator

DEFAULT_ARGS = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': airflow.utils.dates.days_ago(2),
'email': ['airflow@example.com'],
'email_on_failure': False,
'email_on_retry': False
}


HIVE_CLOUDFRONT = [
{
    'Name': 'cloudfront',
    'ActionOnFailure': 'CONTINUE',
    'HadoopJarStep': {
        'Jar': 'command-runner.jar',
        'Args': [
            'hive-script',
             '--run-hive-script',
             '--args',
             '-f', 
             's3://BUCKET/xnder/scripts/Hive_CloudFront.q',
              '-d',
                            'INPUT=s3://BUCKET/',
             '-d',
                            'OUTPUT=s3://BUCKET/output5/'
        ]
    }
}
]

JOB_FLOW_OVERRIDES = …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services directed-acyclic-graphs amazon-emr airflow

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

Cloudfront 的 Cloudformation S3 存储桶主体

我正在尝试为 S3 存储桶上的 Cloudfront 分发创建一个 Yaml 模板。我卡在如何添加principalBucketPolicy

我想知道如何将XXXXXXXXXXXCloudFront Origin Access Identity XXXXXXXXXXX 上的主体替换为将通过部署模板生成的 Cloudfront。

还有一种方法可以在 yaml 模板上添加 html、css 同步程序(我现在正在通过 aws cli 执行)?

请告诉我。TIA

 AWSTemplateFormatVersion: 2010-09-09
 Resources:
   Bucket:
     Type: 'AWS::S3::Bucket'
     Properties:
       BucketName: pridesys.webbucket
       AccessControl: Private 
       WebsiteConfiguration:
         IndexDocument: index.html

   BucketPolicy:
     Type: AWS::S3::BucketPolicy
     Properties:
       Bucket: !Ref Bucket
       PolicyDocument:
         Id: ReportPolicy
         Version: "2012-10-17"
         Statement:
           - Sid: "1"
             Effect: Allow
             Action: "s3:GetObject"
             Principal:
               AWS: "arn:aws:iam::cloudfront:user/CloudFront Origin Access Identity XXXXXXXXXXX"
             Resource: !Join ['', ['arn:aws:s3:::', !Ref Bucket, '/*']]

   Distro:
     Type: 'AWS::CloudFront::Distribution' …
Run Code Online (Sandbox Code Playgroud)

amazon-s3 amazon-web-services amazon-cloudfront aws-cloudformation

4
推荐指数
2
解决办法
3676
查看次数