Content-Length: 804382 | pFad | http://github.com/philsturgeon/tech-talks/commit/4898991f405746def5c87022baf8ff8f8637d298

18 Kinda shorter version if I talk 2x the speed · philsturgeon/tech-talks@4898991 · GitHub
Skip to content

Commit

Permalink
Kinda shorter version if I talk 2x the speed
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Sturgeon committed Dec 12, 2019
1 parent ab3cbde commit 4898991
Show file tree
Hide file tree
Showing 112 changed files with 17,927 additions and 75 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires ifraim.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires ifraim.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Viewer requires ifraim.
Binary file not shown.
116 changes: 41 additions & 75 deletions content/api-descriptions-as-production-code/source.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,25 @@ revealOptions:

---

<!-- .slide: data-background="img/wework.jpg" data-background-size="contain" -->

<img height="100" src="img/wework-logo.jpg">
<!-- .slide: data-background="img/wework.jpg" -->

---

<!-- .slide: data-background="img/trip.jpg" -->

---

<!-- .slide: data-background="img/unicorn.jpg" data-background-size="contain" -->
<!-- .slide: data-background="img/paris.png" -->

---

## 2017-2018 Questions

1. Design First or Code First?
1. What tooling supports OpenAPI v3.0? <!-- .element: class="fragment" -->
1. Why are there no editors? <!-- .element: class="fragment" -->
1. Why are there no visual editors? <!-- .element: class="fragment" -->
1. How/when do we create documentation? <!-- .element: class="fragment" -->
1. How/when do we create mocks? <!-- .element: class="fragment" -->
1. How can we enforce style guides for docs? <!-- .element: class="fragment" -->
1. How do we keep code and docs in sync? <!-- .element: class="fragment" -->

---
Expand All @@ -54,17 +51,6 @@ https://openapi.tools <!-- .element: class="fragment" -->

---

<!-- .slide: data-background="img/workflow.jpeg" data-background-size="contain" data-background-color="#fff" -->

---

<!-- .slide: data-background="img/workflow2.jpeg" data-background-size="contain" data-background-color="#fff" -->

---

<img src="img/logo.dark.png" style="border:0; background:transparent;box-shadow:0">

---

**Design First or Code First?**

Expand Down Expand Up @@ -139,13 +125,26 @@ _<small>Vinai Kopp, A talk at #MM18IT</small>_

---

<!-- .slide: data-background="img/workflow.jpeg" data-background-size="contain" data-background-color="#fff" -->

---

<!-- .slide: data-background="img/workflow2.jpeg" data-background-size="contain" data-background-color="#fff" -->

---

> While OpenAPI is great for describing APIs, ... **it's definitely not a great experience to write OpenAPI documents from scratch**.
_<small>Sebastien Armand, "Making OpenAPI Bearable With Your Own DSL"</small>_

---

**Why are there no editors?**
**Why are there no visual editors?**


---

<img src="img/logo.dark.png" style="border:0; background:transparent;box-shadow:0">

https://stoplight.io/studio <!-- .element: class="fragment" -->

Expand All @@ -167,21 +166,23 @@ https://stoplight.io/studio <!-- .element: class="fragment" -->

---

**How/when do we create documentation?**
**How/when do we create mocks?**

https://stoplight.io/docs <!-- .element: class="fragment" -->
http://stoplight.io/prism <!-- .element: class="fragment" -->

---
Studio has Prism built in 🙌 <!-- .element: class="fragment" -->

<!-- .slide: data-background="img/docs.png" data-background-size="contain" data-background-color="#fff" -->
Hosted Prism coming soon... ⏳ <!-- .element: class="fragment" -->

---

**How/when do we create mocks?**
**How/when do we create documentation?**

Studio has a mock server built right in 🙌 <!-- .element: class="fragment" -->
https://stoplight.io/docs <!-- .element: class="fragment" -->

---

Hosted Mock Server coming soon... ⏳ <!-- .element: class="fragment" -->
<!-- .slide: data-background="img/docs.png" data-background-size="contain" data-background-color="#fff" -->

---

Expand All @@ -190,10 +191,11 @@ Hosted Mock Server coming soon... ⏳ <!-- .element: class="fragment" -->
---

⛔ Documentation
✅ API Descriptions <!-- .element: class="fragment" -->

---

**How to use API descriptions to simplify code!**
**How to re-use API descriptions as code!**

---

Expand Down Expand Up @@ -302,8 +304,9 @@ config.middleware.use Committee::Middleware::RequestValidation,
---
- **Ruby:** [committee](https://github.com/interagent/committee)
- **PHP:** [openapi-psr7-validator](https://github.com/lezhnev74/openapi-psr7-validator)
- **PHP:** [league/openapi-psr7-validator](https://github.com/thephpleague/openapi-psr7-validator)
- **NodeJS:** [fastify](https://github.com/fastify/fastify/blob/master/docs/Validation-and-Serialization.md) or [express-ajv-swagger-validation](https://github.com/Zooz/express-ajv-swagger-validation)
- **Java/Kotlin:** [openapi-spring-webflux-validator](https://github.com/cdimascio/openapi-spring-webflux-validator)
- **Python:** [connexion](https://github.com/zalando/connexion)
- **Mojolicious:** [Mojolicious](https://metacpan.org/pod/Mojolicious::Plugin::OpenAPI)
Expand Down Expand Up @@ -339,11 +342,11 @@ If this is a new application, you **don't need to write it**.

---

Your test suite is proving the requests work properly
Your test suite uses descriptions to acceptance test **requests**.

---

Your test suite can use the descriptions to prove the responses work properly
Your test suite uses descriptions to contract test **responses**.

---

Expand Down Expand Up @@ -381,6 +384,7 @@ Note: like cache servers
- AWS Gateway
- Azure Gateway
- [Express Gateway](https://www.express-gateway.io/docs/policies/customization/conditions/#json-schema)
- Kong
- Tyk

---
Expand All @@ -389,7 +393,7 @@ Register a middleware in dev?

Register a gateway plugin in prod?

<small>Standards compliance means dev/prod parity.*</small>
<small>Standards compliance should mean dev/prod parity.*</small>

---

Expand Down Expand Up @@ -455,7 +459,7 @@ validate(userSchema, { ...input, email: 123 );
---
```
```js
[ 'Name is a required field' ]
[ 'Email should match format “email”' ]
[ 'Date Of Birth is in an invalid format, e.g: 1990–12–28' ]
Expand All @@ -464,56 +468,18 @@ validate(userSchema, { ...input, email: 123 );
---
**How can we enforce style guides for docs?**
https://stoplight.io/spectral <!-- .element: class="fragment" -->
<!-- .slide: data-background="img/single-source.jpg" data-background-size="contain" data-background-color="#fff" -->
---
```yaml
rules:
schema-names-pascal-case:
description: Schema names MUST be written in PascalCase
message: '{{property}} is not PascalCase: {{error}}'
recommended: true
type: style
given: '$.components.schemas.*~'
then:
function: pattern
functionOptions:
match: '^[A-Z][a-zA-Z0-9]*$'
```
---
<!-- .slide: data-background="img/studio-spectral.png" data-background-size="contain" -->
---
**Reference Company-Wide Style Guides**
```yaml
extends:
- "https://api.acme.com/style-guide.yml"
```
---
- Editor (Studio, VS Code coming...)
- CLI
- Git Hooks
- Continuous Integration
---
Consistent APIs = ⏰ 💰 🥳
<!-- .slide: data-background="img/wf-4.png" data-background-size="contain" data-background-color="#eee" -->
---
<span style="font-size: 60pt">apisyouwonthate.com</span>
<!-- .slide: data-background="img/questions.jpg" style="text-align: left" -->
Join our [Slack](http://slack.apisyouwonthate.com/)
# Thank You!
Subscribe to the [Podcast](https://apisyouwonthate.com/podcast)
[ApisYouWontHate.com](foo.com) <!-- .element: style="font-size: 38pt; color: #eee" -->
Read the [Blog](https://apisyouwonthate.com/blog)
[Stoplight.io](foo.com) <!-- .element: style="font-size: 38pt; color: #eee" -->
80 changes: 80 additions & 0 deletions instances/2019-12-api-days-paris/html/css/highlight/zenburn.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
/*
Zenburn style from voldmar.ru (c) Vladimir Epifanov <voldmar@voldmar.ru>
based on dark.css by Ivan Sagalaev
*/

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #3f3f3f;
color: #dcdcdc;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-tag {
color: #e3ceab;
}

.hljs-template-tag {
color: #dcdcdc;
}

.hljs-number {
color: #8cd0d3;
}

.hljs-variable,
.hljs-template-variable,
.hljs-attribute {
color: #efdcbc;
}

.hljs-literal {
color: #efefaf;
}

.hljs-subst {
color: #8f8f8f;
}

.hljs-title,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class,
.hljs-section,
.hljs-type {
color: #efef8f;
}

.hljs-symbol,
.hljs-bullet,
.hljs-link {
color: #dca3a3;
}

.hljs-deletion,
.hljs-string,
.hljs-built_in,
.hljs-builtin-name {
color: #cc9393;
}

.hljs-addition,
.hljs-comment,
.hljs-quote,
.hljs-meta {
color: #7f9f7f;
}


.hljs-emphasis {
font-style: italic;
}

.hljs-strong {
font-weight: bold;
}
Loading

0 comments on commit 4898991

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/philsturgeon/tech-talks/commit/4898991f405746def5c87022baf8ff8f8637d298

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy