RESTful API를 제공 하면서 API 문서를 항상 만들었습니다.
시간이 지남에 따라 제공된 API의 기능들은 추가 되거나 변경/삭제 되어 갔지만, 그에 반해 API 문서는 관리 소홀로 결국에는 불일치(API!=DOC)되면서 겪게 되는 API 문서 관리의 어려움을 우리는 자주 만나고 있습니다.
현재 한참 개발이 진행중인 스프링 프로젝트 중 Spring REST Docs를 사용해 API 문서를 손쉽게 자동으로 생성하고, 테스트까지 함께 할 수 있는 지에 대한 경험을 공유하고자 합니다.
Swagger를 넘어 이제는 Spring REST Docs으로...
이 세션에서는 Spring REST Docs + MVC Test 두 마리 토끼를 한번에 잡을 수 있는 방법을 살펴보고자 합니다.
This presentation introduces the key innovations that Play 2 brings to web application development in Java and Scala. The Play framework has brought high-productivity web development to Java with three innovations that changed the rules on Java EE: Java class and template save-and-reload that just works, a simplified stateless architecture that enables cloud deployment, and superior ease-of-use. Following Play's rapidly-growing popularity, Play 2.0 was released in March 2012 with innovations that are not just new in the Java world: type-safe view templates and HTTP routing, compile-time checking for static resources, and native support for both Java and Scala. Type safety matters. After dynamically-typed programming languages such as PHP and Ruby set the standard for high-productivity web development, Play built on their advantages and has created a type-safe web development framework with extensive compile-time checking. This is essential for applications that will scale to tens of thousands of lines of code, with hundreds of view templates. Meanwhile, Play avoids the architectural-complexity that is promoted by Java EE-based approaches. The result is that Play 2 first enables rapid initial application development and then Play 2 helps you build big, serious and scalable web applications.
RESTful API를 제공 하면서 API 문서를 항상 만들었습니다.
시간이 지남에 따라 제공된 API의 기능들은 추가 되거나 변경/삭제 되어 갔지만, 그에 반해 API 문서는 관리 소홀로 결국에는 불일치(API!=DOC)되면서 겪게 되는 API 문서 관리의 어려움을 우리는 자주 만나고 있습니다.
현재 한참 개발이 진행중인 스프링 프로젝트 중 Spring REST Docs를 사용해 API 문서를 손쉽게 자동으로 생성하고, 테스트까지 함께 할 수 있는 지에 대한 경험을 공유하고자 합니다.
Swagger를 넘어 이제는 Spring REST Docs으로...
이 세션에서는 Spring REST Docs + MVC Test 두 마리 토끼를 한번에 잡을 수 있는 방법을 살펴보고자 합니다.
This presentation introduces the key innovations that Play 2 brings to web application development in Java and Scala. The Play framework has brought high-productivity web development to Java with three innovations that changed the rules on Java EE: Java class and template save-and-reload that just works, a simplified stateless architecture that enables cloud deployment, and superior ease-of-use. Following Play's rapidly-growing popularity, Play 2.0 was released in March 2012 with innovations that are not just new in the Java world: type-safe view templates and HTTP routing, compile-time checking for static resources, and native support for both Java and Scala. Type safety matters. After dynamically-typed programming languages such as PHP and Ruby set the standard for high-productivity web development, Play built on their advantages and has created a type-safe web development framework with extensive compile-time checking. This is essential for applications that will scale to tens of thousands of lines of code, with hundreds of view templates. Meanwhile, Play avoids the architectural-complexity that is promoted by Java EE-based approaches. The result is that Play 2 first enables rapid initial application development and then Play 2 helps you build big, serious and scalable web applications.
Responsive design is forcing us to reevaluate our design and development practices. It's also forcing us to rethink how we communicate with our clients and what a project's deliverables might be. Pattern Lab helps bridge the gap by providing one tool that allows for the creation of modular systems as well as gives clients the tool review the work in the place it's going to be used: the browser.
This talk is a deep dive into how Pattern Lab is organized and how to take advantage of it.
Ant is a Java library and command-line tool. Ant's mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.
Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and are offered a large number of ready-made commercial or open-source "antlibs".
Ant is extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool.
Software development projects looking for a solution combining build tool and dependency management can use Ant in combination with Ivy.
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 MinutesNina Zakharenko
An introduction to the Django REST Framework, given at Djangocon US 2014.
The video for the talk is available here: https://www.youtube.com/watch?v=cqP758k1BaQ
Behaviour Driven Development con Behat & Drupalsparkfabrik
Il Behaviour Driven Development è una pratica di sviluppo software nella quale i comportamenti della propria applicazione vengono descritti con un linguaggio chiaro e comprensibile a tutti. Grazie a Behat, questi scenari si trasformano in test veri e propri che possono essere eseguiti sulle nostre applicazioni Drupal.
Responsive design is forcing us to reevaluate our design and development practices. It's also forcing us to rethink how we communicate with our clients and what a project's deliverables might be. Pattern Lab helps bridge the gap by providing one tool that allows for the creation of modular systems as well as gives clients the tool review the work in the place it's going to be used: the browser.
This talk is a deep dive into how Pattern Lab is organized and how to take advantage of it.
Ant is a Java library and command-line tool. Ant's mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.
Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and are offered a large number of ready-made commercial or open-source "antlibs".
Ant is extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool.
Software development projects looking for a solution combining build tool and dependency management can use Ant in combination with Ivy.
Djangocon 2014 - Django REST Framework - So Easy You Can Learn it in 25 MinutesNina Zakharenko
An introduction to the Django REST Framework, given at Djangocon US 2014.
The video for the talk is available here: https://www.youtube.com/watch?v=cqP758k1BaQ
Behaviour Driven Development con Behat & Drupalsparkfabrik
Il Behaviour Driven Development è una pratica di sviluppo software nella quale i comportamenti della propria applicazione vengono descritti con un linguaggio chiaro e comprensibile a tutti. Grazie a Behat, questi scenari si trasformano in test veri e propri che possono essere eseguiti sulle nostre applicazioni Drupal.
연구자 및 교육자를 위한 계산 및 분석 플랫폼 설계 - PyCon KR 2015Jeongkyu Shin
현대 과학 연구에는 컴퓨터를 이용한 계산 및 분석 작업이 필수적입니다. 그러나 거대 스케일의 계산 및 분석 작업을 수행할 경우 컴퓨팅 리소스의 적절한 관리 및 확장 용이성을 확보하는 것은 많은 리소스를 필요로 합니다. 우리는 컴퓨터 계산 작업 및 분석 작업을 표준화하고 클라우드에서 처리하는 파이썬3 기반의 오픈소스 플랫폼을 설계 및 개발하고 있습니다. 또한 이 플랫폼 위에서 돌아가는 교육 / 연구 플랫폼을 함께 설계하고 있습니다.
새로운 서비스를 변화하는 환경에 맞추어 개발하는 일은 즐거운 경험인 동시에, "무엇을" "어떻게" "왜" 로 이어지는 지뢰밭을 거니는 일이기도 합니다. "무엇을" 만들지 고민하고 토론하며 결정하고, 설계하고, 토론하고, 목표가 바뀌는 과정이 일어납니다. "어떻게" 만드느냐의 지뢰들로는 python 2에서 python 3 로의 전환, 웹 프레임웍인 Django와 프론트엔드 프레임웍들과의 충돌, 아마존 elastic computing cloud와 docker를 사용한 디플로이 시나리오 등 삽질 중에 발생하는 일들이 있습니다. "왜"에 대한 질문들은 무겁지만 피해갈 수 없습니다. "왜 하필 파이썬인가?" "왜 하필 그런 서비스를 만드려 하는가" 등의 질문은, 무엇인가를 만들기로 결심한 사람들에게 주어지는 가장 중요한 질문이자 보상이기도 합니다.
저희는 지난 2개월동안 이 과정을 통해 우리가 배운 것들을 공유하고자 합니다. 구체적으로는 개발 중인 플랫폼 구조, 설계 과정의 경험 및 python 3 기반의 플랫폼 개발시 주의할 점들에 대해 이야기하고, 그와 함께 지뢰밭을 걷게 만든 '원동력' 에 대해 함께 이야기할 수 있는 자리가 되었으면 합니다.
빅데이터 구축 및 술루션 가이드 주요 내용
- 고객 내부 빅데이터 프로젝트 진행시 단계별 진행 가이드
- 빅데이터 프로젝트 구축 타입
- 각 산업분야별로 빅데이터 엔진을 활용한 솔루션 구축 가이드
(딥 러닝 기법 기반의 분석 포함)
코세나(kosena), 이승훈 실장 admin@kosena.kr, kosena21@naver.com
010-9338-6400
An introduction to REST and RESTful web services.
You can take the course below to learn about REST & RESTful web services.
https://www.udemy.com/building-php-restful-web-services/
CCI2018 - Automatizzare la creazione di risorse con ARM template e PowerShellwalk2talk srl
Su Azure è possibile creare risorse in maniera veloce e standardizzata tramite template json che descrivono le risorse da creare sulla piattaforma. Vediamo insieme cosa possono fare, e come possono essere estesi con custom script extension e Powershell Desired State Configuration.
By Marco Obinu
These are my slide from talk at PHPDay in Verona 20014.
Forget about classic website where UX is not so important. We are living in time where usability is one of the important thing if you are building some business client oriented web service. In locastic we are working on CRM that is based on Symfony2 as backend and AngularJS as frontend solution.
How to connect this two frameworks? What are best practices? What are disadvantageous? How to take best from both worlds? These are topics I will cover in my talk with real examples.
Accessibility Testing is one of the important types of testing that add value to your business and deliver user friendly applications. Axe Core is a very powerful framework that can help the team to build web products that are inclusive. In this article, different ways to test the Accessibility and the automation part have been discussed in full length. You can achieve Accessibility Testing with the help of the following methods/approaches
Use Angular Schematics to Simplify Your Life - Develop Denver 2019Matt Raible
Angular Schematics give developers a way to manipulate projects with code. Not just Angular projects, but any project that has a package.json file! Learn how to use them in this talk.
Blog post: https://developer.okta.com/blog/2019/02/13/angular-schematics
GitHub repo: https://github.com/oktadeveloper/schematics
A Gentle Introduction to Angular Schematics - Angular SF 2019Matt Raible
You might’ve heard of Angular Schematics, but do you know what they do? Learn how you can use this powerful tool to develop workflows and simplify configurations for your Angular projects.
Blog post: https://developer.okta.com/blog/2019/02/13/angular-schematics
Source code: https://github.com/oktadeveloper/okta-angular-schematics-example
Screencast: https://youtu.be/ANwZIt3Ni2s
Test-Driven Documentation for your REST(ful) serviceJeroen Reijn
Building RESTful APIs in Java? Getting tired of the annotation bloat forced upon you by your API specification framework which haunts your RESTful service controllers and model objects? Finding yourself in the situation where your code isn’t always in synch with your specification or vice versa?
RAML and Swagger / OpenAPI are great specifications with powerful and shiny tooling, but they do also really have their downsides when it comes to messing with our code.
Fear not! There are other alternatives worth investigating. In this talk, we’ll take a look at how we recently build, designed and documented a public REST API by doing Test Driven Documentation with some help of AsciiDoc and Spring (Auto) REST Docs.
Since late 2009 there is Spring 3 published. Some things are new, something keep and something was removed.
Thos talk discuss the changes of the 3rd edition of Spring and introduce Spring Roo, Grails and the SpringSource Toolsuite.
Yet Another Fog Simulator (YAFS) - user guidewisaaco
YAFS (Yet Another Fog Simulator) is a simulator tool based on Python of architectures such as Fog Computing ecosystems for analysis regarding the placement of resources, cost deployment, network design,... IoT environments are the most evident fact of this type of architecture.
Connector Corner: Automate dynamic content and events by pushing a buttonDianaGray10
Here is something new! In our next Connector Corner webinar, we will demonstrate how you can use a single workflow to:
Create a campaign using Mailchimp with merge tags/fields
Send an interactive Slack channel message (using buttons)
Have the message received by managers and peers along with a test email for review
But there’s more:
In a second workflow supporting the same use case, you’ll see:
Your campaign sent to target colleagues for approval
If the “Approve” button is clicked, a Jira/Zendesk ticket is created for the marketing design team
But—if the “Reject” button is pushed, colleagues will be alerted via Slack message
Join us to learn more about this new, human-in-the-loop capability, brought to you by Integration Service connectors.
And...
Speakers:
Akshay Agnihotri, Product Manager
Charlie Greenberg, Host
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualityInflectra
In this insightful webinar, Inflectra explores how artificial intelligence (AI) is transforming software development and testing. Discover how AI-powered tools are revolutionizing every stage of the software development lifecycle (SDLC), from design and prototyping to testing, deployment, and monitoring.
Learn about:
• The Future of Testing: How AI is shifting testing towards verification, analysis, and higher-level skills, while reducing repetitive tasks.
• Test Automation: How AI-powered test case generation, optimization, and self-healing tests are making testing more efficient and effective.
• Visual Testing: Explore the emerging capabilities of AI in visual testing and how it's set to revolutionize UI verification.
• Inflectra's AI Solutions: See demonstrations of Inflectra's cutting-edge AI tools like the ChatGPT plugin and Azure Open AI platform, designed to streamline your testing process.
Whether you're a developer, tester, or QA professional, this webinar will give you valuable insights into how AI is shaping the future of software delivery.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
JMeter webinar - integration with InfluxDB and GrafanaRTTS
Watch this recorded webinar about real-time monitoring of application performance. See how to integrate Apache JMeter, the open-source leader in performance testing, with InfluxDB, the open-source time-series database, and Grafana, the open-source analytics and visualization application.
In this webinar, we will review the benefits of leveraging InfluxDB and Grafana when executing load tests and demonstrate how these tools are used to visualize performance metrics.
Length: 30 minutes
Session Overview
-------------------------------------------
During this webinar, we will cover the following topics while demonstrating the integrations of JMeter, InfluxDB and Grafana:
- What out-of-the-box solutions are available for real-time monitoring JMeter tests?
- What are the benefits of integrating InfluxDB and Grafana into the load testing stack?
- Which features are provided by Grafana?
- Demonstration of InfluxDB and Grafana using a practice web application
To view the webinar recording, go to:
https://www.rttsweb.com/jmeter-integration-webinar
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Accelerate your Kubernetes clusters with Varnish CachingThijs Feryn
A presentation about the usage and availability of Varnish on Kubernetes. This talk explores the capabilities of Varnish caching and shows how to use the Varnish Helm chart to deploy it to Kubernetes.
This presentation was delivered at K8SUG Singapore. See https://feryn.eu/presentations/accelerate-your-kubernetes-clusters-with-varnish-caching-k8sug-singapore-28-2024 for more details.
9. Sample Application
• Spring Data REST :
• https://github.com/spring-projects/spring-restdocs/tree/master/samples/rest-notes-spring-data-rest
• Spring HATEOAS :
• https://github.com/spring-projects/spring-restdocs/tree/master/samples/rest-notes-spring-hateoas
• HATEOAS : Hypermedia As the Engine Of Application State
10. • api-guide.adoc : API guide
• ApiDocumentation.java
• getting-started-guide.adoc : getting started guide
• GettingStartedDocumentation.java
• Spring Data REST
16. Generating documentation
snippets
• Spring REST Docs은 MVC Test framework을 사용
• MVC test framework doc
• http://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#spring-mvc-test-framework
17. Setting up Spring MVC Test
@Rule
public final RestDocumentation restDocumentation = new RestDocumentation("build/generated-snippets");
@Autowired
private WebApplicationContext context;
private MockMvc mockMvc;
@Before
public void setUp() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
.apply(documentationConfiguration(this.restDocumentation))
.build();
}
1) snippets을 생성하기위해 @Rule annotation
을 이용, RestDocumentation 을 선언, “build/
generated-snippets” pom.xml 에서 선언되
어있음
2) MockMvc instance를 생성키위해 @Before에서 setUp()
method 선언, MockMvc의 instance는
RestDocumentationMockMvcConfigurer 를 사용해서 설정할 수
있는데, static documentationConfiguration() method로 얻을
수 있다. documentationConfiguration의 method들?
18. @Rule
public final RestDocumentation restDocumentation = new RestDocumentation("build/generated-snippets");
@Autowired
private WebApplicationContext context;
private MockMvc mockMvc;
@Before
public void setUp() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
.apply(documentationConfiguration(this.restDocumentation))
.build();
}
documentationConfiguration은 URIs 설정할 수 있는데, 아래와 같이
사용이 가능하다.
documentationConfiguration(this.restDocumentation).uris()
.withScheme(“https”)
.withHost("example.com")
.withPort(443)
32. public void example() {
ConstraintDescriptions userConstraints = new ConstraintDescriptions(UserInput.class);
List<String> descriptions = userConstraints.descriptionsForProperty("name");
}
static class UserInput {
@NotNull
@Size(min = 1)
String name;
@NotNull
@Size(min = 8)
String password;
1) ConstraintDescriptions의 instance를 생성
2) name property의 constraint를 가져온다. List 에는 NotNull
조건과 Size 조건이 있다.
Bean Validation 1.1의 constraints 모두 지원한다.
AssertFalse, AssertTrue, DecimalMax, DecimalMin, Digits,
Future, Max, Min, NotNull, Null, Past, Pattern, Size
33. .andDo(document("create-user", requestFields(
attributes(
key("title").value("Fields for user creation")),
fieldWithPath("name")
.description("The user's name")
.attributes(
key("constraints").value("Must not be null. Must not be empty")),
fieldWithPath("email")
.description("The user's email address")
.attributes(
key("constraints").value("Must be a valid email address")))));
request field의 extra information으로
constraints를 문서화도 가능함
name field에 “constraints” 속성을 설정할 수 있다.
35. 8) Using parameterised output directories
• output 디렉토리를 위해 아래 parameter를 지원.
_ ( userscore) 를 사용
-(dash) 를 사용
36. @Before
public void setUp() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)
.apply(documentationConfiguration(this.restDocumentation))
.alwaysDo(document("{method-name}/{step}/"))
.build();
} alwaysDo 를 사용하고, method-name이
creatingANote 라면, 디렉토리는 creating-a-note/1/
이라는 이름에 snippet이 저장된다.
37. 9) Customising the output
• 9-1) Spring REST Docs : Mustache template를 사
용
• ./spring-restdocs-core/build/resources/main/org/springframework/restdocs/templates/
*.snippet
• curl-request.adoc 을 위해 template 을 사용하려면,
• src/test/resources/org/springframework/restdocs/templates/curl-request.snippet 을 만들어
서 사용하면 됨.
38. .andDo(document("create-user", requestFields(
attributes(
key("title").value("Fields for user creation")),
fieldWithPath("name")
.description("The user's name")
.attributes(
key("constraints").value("Must not be null. Must not be empty")),
fieldWithPath("email")
.description("The user's email address")
.attributes(
key("constraints").value("Must be a valid email address")))));
9-2) including extra information
1) attributes() method를 사용하고, “title” attribute를 설정
2) “name” 의 constraints를 설정
3) “email” 의 constraints를 설정
custom template : request-fields.snippet 설정
39. custom template : request-fields.snippet
.{{title}}
|===
|Path|Type|Description|Constraints
{{#fields}}
|{{path}}
|{{type}}
|{{description}}
|{{constraints}}
{{/fields}}
|===
1) 테이블에 title 추가
2) 새로운 column “Constraints” 추가
3) 테이블의 각 row 에 “constraints” 속성의 설명을 포함
46. Working with Asciidoctor
• asciidoctor syntax
• http://asciidoctor.org/docs/asciidoc-syntax-quick-reference/
• asciidoctor user manual
• http://asciidoctor.org/docs/user-manual
47. 1) including snippets
• 특정 snippet을 포함시킬 수 있음.
• include::{snippets}/index/curl-request.adoc[]
48. 2) Customising tables
• Formatting columns
• Configuring the title
• User manual :
• http://asciidoctor.org/docs/user-manual/#tables
51. spring-boot 설치
• 추천 버전
• Spring Boot v1.1.4 release
• Mac OS X 환경에 설치
$ brew tap pivotal/tap
$ brew install springboot
http://docs.spring.io/autorepo/docs/spring-boot/1.1.4.RELEASE/reference/html/getting-started-installing-spring-boot.html
52. java & mvn & intelliJ
• 최소 스펙
• Java : 1.6 +
• maven : 3.0 +
• Mac OS X
• java : 1.7.0_79
• maven : 3.2.5
• intelliJ IDEA 14.1.5+
54. …
[[overview-errors]]
== Errors
Whenever an error response (status code >= 400) is returned, the body will contain a JSON object
that describes the problem. The error object has the following structure:
include::{snippets}/error-example/response-fields.adoc[]
For example, a request that attempts to apply a non-existent tag to a note will produce a
`400 Bad Request` response:
include::{snippets}/error-example/http-response.adoc[]
[[overview-hypermedia]]
…
api-guide.doc
55.
56. MockHttpServletRequest:
HTTP Method = GET
Request URI = /error
Parameters = {}
Headers = {}
Handler:
Type = org.springframework.boot.autoconfigure.web.BasicErrorController
Method = public org.springframework.http.ResponseEntity<java.util.Map<java.lang.String, java.lang.Object>>
org.springframework.boot.autoconfigure.web.BasicErrorController.error(javax.servlet.http.HttpServletRequest)
Async:
Async started = false
Async result = null
Resolved Exception:
Type = null
ModelAndView:
View name = null
View = null
Model = null
FlashMap:
MockHttpServletResponse:
Status = 400
Error message = null
Headers = {Content-Type=[application/json;charset=UTF-8]}
Content type = application/json;charset=UTF-8
Body = {
"timestamp" : 1447748756746,
"status" : 400,
"error" : "Bad Request",
"message" : "The tag 'http://localhost:8080/tags/123' does not exist",
"path" : "/notes"
}
Forwarded URL = null
Redirected URL = null
Cookies = []
Process finished with exit code 0
IntelliJ Output :
57. ~/spring-restdocs/samples/rest-notes-spring-data-rest/target/generated-snippets/error-example$ ls -la
total 32
drwxr-xr-x 6 EricAhn staff 204 Nov 17 17:25 .
drwxr-xr-x 3 EricAhn staff 102 Nov 17 17:25 ..
-rw-r--r-- 1 EricAhn staff 63 Nov 17 17:25 curl-request.adoc
-rw-r--r-- 1 EricAhn staff 60 Nov 17 17:25 http-request.adoc
-rw-r--r-- 1 EricAhn staff 287 Nov 17 17:25 http-response.adoc
-rw-r--r-- 1 EricAhn staff 340 Nov 17 17:25 response-fields.adoc
58. $ cd spring-restdocs/samples/rest-notes-spring-data-rest/src/main/asciidoc
$ cp -R target/generated-snippets/error-example .
$ ls
drwxr-xr-x 7 EricAhn staff 238 Nov 17 22:14 .
drwxr-xr-x 5 EricAhn staff 170 Nov 12 15:21 ..
-rw-r--r-- 1 EricAhn staff 5985 Nov 17 22:23 api-guide.adoc
drwxr-xr-x 6 EricAhn staff 204 Nov 17 22:12 error-example
-rw-r--r-- 1 EricAhn staff 5888 Nov 12 15:21 getting-started-guide.adoc